开发者

JSF 2.0 f:setPropertyActionListener

开发者 https://www.devze.com 2023-02-20 03:05 出处:网络
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 init

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

精彩评论

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