Strange behavior with a4j:commandLink and rich:tree
horrikhalid Apr 5, 2011 8:10 AMHello,
After a long search in the forum I found my self with unsolvable problem.
First let me explain what I have:
In the jsf page I have two rich:tree component one for users and one for City/Quarter, rich:datatable and a4j:commandLink.
<a4j:commandLink value="#{msg.save}" ajaxSingle="true" actionListener="#{assignmentBean.assignUserAction}" styleClass="button" reRender="userTree,tree,doctorsTable/>
<rich:tree id="tree" styleClass="tree1" nodeSelectListener="#{assignmentBean.nodeSelectListener}" stateAdvisor="#{treeAdvisor}" reRender="selectedNode, tree,doctorsTable" ajaxSubmitSelection="true" switchType="client" value="#{assignmentBean.treeNode}" var="item" componentState="#{assignmentBean.treeState}" ajaxSingle="true"> <rich:treeNode iconLeaf="../../img/leaf.png" icon="../../img/node.png"> <h:selectBooleanCheckbox value="#{item.selected}" disabled="true"/> <h:outputText value="#{item.libelle}" /> </rich:treeNode> </rich:tree>
<rich:dataTable id="doctorssTable" value="#{assignmentBean.doctorRelations}" var="userDoctorRelation" columnClasses="center" rows="100"> somethings here... <rich:column width="60" label="#{msg.potentiellabel}"> <h:selectOneMenu id="potentiel" value="#{userDoctorRelation.potentiel.id}" style="width: 50px;"> <t:selectItems value="#{assignmentBean.potentiels}" var="potentiel" itemLabel="#{potentiel.label}" itemValue="#{potentiel.id}"/> </h:selectOneMenu> </rich:column>
First Case :If I make the ajaxSingle="true" in the commandLink the UserDoctorRelation object is not updated, So any change with selectOneMenu is not make any change in the model.
Second Case : If I remove ajaxSingle from commandLink the model (UserDoctorRelation) is updated but the City/Quarter's nodeSelectListener is fired again, but no thing happen with users tree.
In the RF documentation I found explaination about ajaxSignle:
Limits JSF tree processing (decoding, conversion, validation and model updating) only to a component that sends the request. Boolean. Default value is "false".
Using the fireBug I can see that the selectOneMenu values are sent with the request, but the update phase are not happen for this values.
I want just to update the model without fire the nodeSelectListener.
Thnx in advance.