1 Reply Latest reply on Feb 25, 2011 11:47 AM by Martin Frey

    rich:tree -- unable to generate labels dynamically?

    Cris Grama Newbie
      Hello all,

      I have some trouble working with dynamically-generated trees, i.e. trees containing labels read from the database.

      In my app, I am showing a list of problems (in a rich datatable). When the user clicks on a problem, a tree containing names of photos associated to that problem is shown. Even though the photos associated to the selected problem are correctly read from the database, the default values that I use are shown.

      Relevant snippets:

      I show it like this:
      <rich:tree ajaxKeys="#{null}" style="width:300px" nodeSelectListener="#{treeBean.processSelection}"
          reRender="selectedNode" ajaxSubmitSelection="true" switchType="server" value="#{treeBean.treeNode}">
      </rich:tree>

      And in the bean I have the method for getting the treeNode: public TreeNode getTreeNode()

      I have debugged this and I don't understand how it works. Does something else happen to the value of treeNode between the return of getTreeNode() and the displaying in the rich:tree?
      I print out the value of treeNode right before the return of getTreeNode() and it is correct, but the displayed value is the default.

      Can anyone explain why this happens and/or how this works internally? Thanks!
      --Cristina.