开发者

JSF 2.0 f:setPropertyActionListener

I would like to nest multiple setPropertyActionListener's in my commandLink but only one works. How do you attempt this? This command link sets properties and then opens a dialog so its basically initializing the dialog.

How is this accomplished?

<p:commandLink update=":dreamWebSearchFrm" value="#{bundle['dreamModify.search.link.TEXT']}" oncomplete="webSearchDlg.show()">
    <f:setPropertyActionListener value="false" target="#{dreamSearchBean.shouldRender}"/>开发者_StackOverflow社区;
    <f:setPropertyActionListener value="true" target="#{dreamSearchBean.shouldRender1}"/>
</p:commandLink>


You could make use of EL parameters and call a single method on your bean. From that method, update whatever you want.

e.g.

#{dreamSearchBean.shouldRenderInit(false, true)}

In your bean:

public void shouldRenderInit(boolean one, boolean two) {
    setShouldRender(one);
    setShouldRender1(two);
}


I try with

<p:commandLink update=":dreamWebSearchFrm" value="#{bundle['dreamModify.search.link.TEXT']}" oncomplete="webSearchDlg.show()">
   <f:setPropertyActionListener value="#{false}" target="#{dreamSearchBean.shouldRender}"/>
   <f:setPropertyActionListener value="#{true}" target="#{dreamSearchBean.shouldRender1}"/>
</p:commandLink>

It is correct with JSF 1.2 and richfaces.


I use the following command to set property value

<f:setPropertyActionListener
        target="#{facRwMappingListBean.facRwMapping.finalActionCdDesc}"
    value="#{gridData.finalActionCdDesc}" />

Mine is working fine. Your code looks correct except the value="true" part. Try to pass boolean value in the following way.

value=#{"true"}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜