I'm trying to trigger two listeners after an event valueChange, like that:
<h:selectOneListbox id="premiumLevel"
value="#{createPremiumUserDTO.premiumLevel}" size="1"
rendered="#{createPremiumUser.step >= 2}">
<f:selectItem itemValue="9" itemLabel="Partner (9)" />
<f:selectItem itemValue="10" itemLabel="Musiclabel (10)" />
<f:selectItem itemValue="11" itemLabel="Series (11)" />
<f:selectItem itemValue="12" itemLabel="Filme (12)" />
<f:selectItem itemValue="13" itemLabel="Syndication (13)" />
<f:ajax listener="#{createPremiumUser.getBusinessRuleSets(createPremiumUserDTO.premiumLevel)}"
render="businessRule" />
<f:ajax listener="#{createPremiumUser.getEncodingParameters(createPremiumUserDTO.premiumLevel, createPremiumUserDTO.defaultBusinessRuleSetId, createPremiumUserDTO.defaultEncodingParameter)}"
render="encodingParameter" />
</h:selectOneListbox>
But i've noticed, the second f:ajax listener is completely ignored. My generated HTML only references the first one. How can i add a second listener to the same element? Is it possible in anyway?
Thanks in advance! Rodrigo
-- UPDATE:
Found a solution, thanks to Bachboss' comment. It seems like my implementation was wrong from the beginning. As my target elements (businessRule and encodingParameter) already call these respective listeners, there is no need to call it under the f:ajax tag. So...
<f:ajax render="businessRule encodingParameter" />
... is enough, and forces both elements to re-render, and they will call the respective methods.
Thanks a lot, Bachboss! Rodrigo