Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

f:param tag attribute 'disable' is not work

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.

like image 352
Maks Avatar asked Jun 09 '11 20:06

Maks


2 Answers

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.

like image 89
BalusC Avatar answered Nov 15 '22 11:11

BalusC


Use 'disble' instead 'disable'. The reason is described here: http://markmail.org/message/bmb2lek5mcx4ofp7

like image 30
andrejs82 Avatar answered Nov 15 '22 11:11

andrejs82