Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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}"/>
    <f:setPropertyActionListener value="true" target="#{dreamSearchBean.shouldRender1}"/>
</p:commandLink>
like image 992
c12 Avatar asked Jan 24 '26 08:01

c12


1 Answers

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);
}
like image 128
Arjan Tijms Avatar answered Jan 27 '26 00:01

Arjan Tijms