I have a p:autoComplete
component where I want to show links based on the selected item. A visual example:
To do so, I update a component when the value of the p:autoComplete
changes. Part of this is having a p:ajax
listener on the clear
event. This works great as long as the auto complete component is not required. When it is required, I run into a required validator message which is displayed.
So, I'm trying to skip validation when a request is triggered by the clear
event. Inspired by JSF skip Required-Validation without immediate=true, I've tried:
<p:autoComplete required="#{param['javax.faces.source'] ne component.clientId and ...}" ...> <p:ajax event="clear" update="..."/> </p:autoComplete>
and:
<p:autoComplete required="#{empty param['primefaces.resetvalues'] and ...}" ...> <p:ajax event="clear" update="..." resetValues="true"/> </p:autoComplete>
but both are not working. Is what I want at all possible? Please note that the component is used as a custom tag, so I cannot hardcode the full clientId.
I'm using JSF 2.3 (bundled with a recent Payara 5).