-
1. Re: Tree element on cascade selection problems
fluna Jul 18, 2012 7:27 AM (in response to fluna)Finally i´ve found the solution.
The best way to fix the problem is use <f:setPropertyActionListener> instead of a <a4j:jsfunction>
This functionality allows to reload a backing bean property without problems.
The code remains like below:
<rich:column colspan="2" style="border:0;">
<a4j:outputPanel id="opModTreeNode">
<rich:tree switchType="client" id="modTree" binding="#{beanProfiles.modTree}">
<rich:recursiveTreeNodesAdaptor
roots="#{beanProfiles.menusesProfile}" var="item"
nodes="#{item.children}">
<rich:treeNode >
<h:selectBooleanCheckbox value="#{item.selected}" style="#{item.style}">
<a4j:support event="onclick"
action="#{beanProfiles.cambiarCheckBox}"
reRender="opModTreeNode">
<f:setPropertyActionListener value="#{item.nseqMenu}" target="#{beanProfiles.currentMenuId}" />
</a4j:support>
</h:selectBooleanCheckbox>
<h:outputText value="#{item.strSelected}" style="white-space:nowrap;"></h:outputText>
</rich:treeNode>
</rich:recursiveTreeNodesAdaptor>
</rich:tree>
</a4j:outputPanel>
</rich:column>