1 Reply Latest reply on Dec 13, 2009 7:56 PM by nbelaevski

    rich:tree state

    mafym

      Hi!

      I am having issues in keeping the state of a rich:tree.

      <rich:tree id="tree" eventsQueue="queue" value="#{valuation.root}" var="item"
       treeNodeVar="node" switchType="client" ajaxSubmitSelection="true" stateVar="stateVar"
       adviseNodeOpened="#{treeStateController.adviseTreeNodeOpened}"
       adviseNodeSelected="#{treeStateController.adviseTreeNodeSelected}"
       changeExpandListener="#{treeStateController.changeExpandListener}"
       nodeSelectListener="#{treeStateController.nodeSelectListener}"
       toggleOnClick="true" rowKeyVar="rk"
       style="width:870px">


      the changeExpandListener is not triggered when the tree triangle icon for expand/collapse is pressed, only when the node itself is selected (clicked).

      How to call changeExpandListener when the tree triangle icon for expand/collapse is pressed?

      Thanks!

        • 1. Re: rich:tree state
          nbelaevski

          Hi,

           

          You are using switchType="client" together with ajaxSubmitSelection="true". This means that expansion using icons happens solely on the client, while selection does ajax submission, thus updating server with the new state of tree nodes. Either use switchType="ajax" or switchType="server" or add a button/a4j:support that will do actual submit.