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 of disable="#{true}"
works for me.
So, it's either a bug in the tag documentation that it supports ValueExpression
or a bug in the UIParameter
class that it does not resolve it as a ValueExpression
. 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.
<h:outputLink value="/WebApplication10/faces/index.xhtml">
Link1
<c:if test="#{!true}"><f:param name="name1" value="value1"/></c:if>
<c:if test="#{!false}"><f:param name="name2" value="value2"/></c:if>
</h:outputLink>
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 the test
condition depends on the iterated variable.
Use 'disble' instead 'disable'. The reason is described here: http://markmail.org/message/bmb2lek5mcx4ofp7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With