I try to use <f:param> tag to build output link URL with parameters depending on some my conditions.
When I place this tag inside h:output link and try to set different values for ‘disable’ I see no effect.
Here the my code
<h:outputLink value="/WebApplication10/faces/index.xhtml">
Link1
<f:param disable="#{true}" name="name1" value="value1"/>
<f:param disable="#{false}" name="name2" value="value2"/>
</h:outputLink>
I expect to see only one param in url but I see both.
Using
disable="true"instead ofdisable="#{true}"works for me.So, it’s either a bug in the tag documentation that it supports
ValueExpressionor a bug in theUIParameterclass that it does not resolve it as aValueExpression. I have at least reported issue 2102 for this.Update: As a temporary hack/workaround, you could use
<c:if>to control the inclusion of the<f:param>tag during view build time.Note that this is not going to work when this piece is embedded in a JSF iterated component such as
<ui:repeat>,<h:dataTable>and on and thetestcondition depends on the iterated variable.