Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could use <a href="https://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_changeExpandListener.html" rel="nofollow noreferrer">ChangeExpandListener</a> </p> <p>The <code>&lt;rich:changeExpandListener&gt;</code> represents an action listener method that is notified on an expand/collapse event on the node. </p> <p>EDIT:</p> <p>First <em>changeExpandListener</em> has to be delared as attribute for <code>&lt;rich:treeNode&gt;</code>, if is declared for entired tree works as you write (event is processed after selection event). So:</p> <pre><code>&lt;rich:tree value="#{simpleTreeBean.treeNode}" var="item" &gt; &lt;rich:treeNode changeExpandListener="#{simpleTreeBean.processExpansion}"&gt; &lt;h:outputText value="#{item}" /&gt; &lt;/rich:treeNode&gt; &lt;/rich:tree&gt; </code></pre> <p><strong>processExpansion</strong> method must take <em>NodeExpandedEvent</em> as a parameter but there is no need to implement interface <em>org.richfaces.event.NodeExpandedListener</em>.</p> <pre><code>public void processExpansion(NodeExpandedEvent evt) { Object source = evt.getSource(); if (source instanceof HtmlTreeNode) { UITree tree = ((HtmlTreeNode) source).getUITree(); if (tree == null) { return; } // get the row key i.e. id of the given node. Object rowKey = tree.getRowKey(); // get the model node of this node. TreeRowKey key = (TreeRowKey) tree.getRowKey(); TreeState state = (TreeState) tree.getComponentState(); if (state.isExpanded(key)) { System.out.println(rowKey + " - expanded"); } else { System.out.println(rowKey + " - collapsed"); } } } </code></pre> <p>That's should help </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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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