I'm using the following code to cause custom validators to skip validation on certain button presses :
<p:commandButton ... value="Don't Validate">
<f:param name="triggerValidation" value="false"/>
</p:commandButton>
Which is working quite nicely. However I can't seem to get this to work when using the <p:fileDownload>
component :
<p:commandButton ... value="Don't Validate">
<p:fileDownload value="#{someWebBean.download()}">
<f:param name="triggerValidation" value="false"/>
</p:fileDownload>
</p:commandButton>
The triggerValidation
parameter is null
by the time it gets to the validator (regardless of whether the <f:param>
element is a child of the <p:commandButton>
or <p:fileDownload>
component).
The code inside the base class of the custom validators get this parameter:
Object o = ((HttpServletRequest) context.getExternalContext().getRequest()).getParameter("triggerValidation");
Any insight into why this is happening would be greatly appreciated!