1 Reply Latest reply on Mar 23, 2012 7:31 AM by mhn

    rich:tree inside a datalist not working in combination with ajax because row information is lost (version 4.2)

    mhn

      I use a datalist in order to iterate over some groups.

      The groups can be expanded or collapsed via a a4j:commandLink which re-renders only the current row of the datalist.

      The items of a group are rendered as radios, checkboxes or trees.

       

      Unfortunaltey (only) the trees are not working with richfaces 4.2 in combination with ajax commands.

      The tree is re-rendered via the ajax commandlink but it's value attribute is not resolved correctly.

      The value attribute of the tree refers to the var attribute of the outer datalist and this attribute is not valid anymore and points to the first row always!

       

      Simplified structure:

      <t:dataList id="groups"

                  value="#{MyDataController.groups}"

                 var="asGroup">

        <h:panelGroup rendered="#{empty asGroup.parent}">

          <!--command expands/collaps a group-->

          <a4j:commandLink actionListener="#{MyDataController.toggleGroup}"

                           execute="@this"

                           render="atBox"

                           value="#{asGroup.name}">

            <f:param name="dispTax" value="#{asGroup.name}"/>

          </a4j:commandLink>

       

          <t:div id="atBox">

           <h:panelGroup rendered="#{asGroup.open and (asGroup.type=='selectOneRadio' || asGroup.type=='selectManyCheckbox')}"> 

           ...

           <h:panelGroup>

           <h:panelGroup rendered="#{asGroup.open and asGroup.type=='tree'}">

             <div>

               <a4j:region id="arATTaxTree">

                 <rich:tree id="treeATItems"

                            value="#{MyDataController.treeControllers[asGroup.name].treeModel}"

                            var="node"

       

       

      The tree does also not work if I rerender the complete outher list (groups)!

      However the tree is shown correctly if I reload the complete page via a non ajax command!       

       

       

      With richfaces 3.3.3 it worked with an ajaxListener of type ForceRender:

          <a4j:commandLink ajaxSingle="true"

                           reRender="atBox"

                           value="#{asGroup.name}">

            <a4j:actionparam name="foo"

                             assignTo="#{MyDataController.myVar}"

                             value="#{asGroup.name}"

                             actionListener="#{MyDataController.toggleGroup}" />

            <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>

       

       

      Question: Is there any important attribute of the rich:tree which solves this issue or is this simply a bug?