Note that there are some explanatory texts on larger screens.

plurals
  1. POrich:tree -- unable to generate leaves dynamically?
    primarykey
    data
    text
    <p>I have some trouble working with dynamically-generated trees, i.e. trees whose leaves are read from the database.</p> <p>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 tree's leaves contain only the default test values that I set in the beginning.</p> <p>Relevant snippets:</p> <p>The tree is contained in a form and it looks like this:</p> <pre><code>&lt;rich:tree style="width:300px" nodeSelectListener="#{treeBean.processSelection}" reRender="selectedNode" ajaxSubmitSelection="true" switchType="server" value="#{treeBean.treeNode}"&gt; &lt;/rich:tree&gt; </code></pre> <p>And in the bean I have the method for getting the treeNode: <code>public TreeNode getTreeNode()</code></p> <p>I have debugged this and I don't understand how it works. Does something else happen to the value of <strong>treeNode</strong> between the return of <strong>getTreeNode()</strong> 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 not the one printed out.</p> <p>Can anyone explain why this happens and/or how this works internally? Thanks!</p> <p><strong>EDIT: After debugging in more detail, I think that the getTreeNode() method is only invoked once, during rendering of the page on which the tree will be shown. How can the rich:tree component be forced to call this method every time the tree is to be shown?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload