2 Replies Latest reply on Jul 15, 2009 10:22 AM by Rafael Duque

    Can i show my treeNode open?

    Rafael Duque Newbie

      Hi,
      i need display my treeNode open, if it's checked.
      I am using TreeNodeImpl and i created the follow object:

      public class SelectedObject {
       private String id;
       private String name;
       private boolean selected = false;
      
       public String getId() {
       return id;
       }
       public void setId(String id) {
       this.id = id;
       }
       public String getName() {
       return name;
       }
       public void setName(String name) {
       this.name = name;
       }
       public boolean isSelected() {
       return selected;
       }
       public void setSelected(boolean selected) {
       this.selected = selected;
       }
      }


      I'm using this object:
      TreeNodeImpl<SelectedObject> tree = new TreeNodeImpl<SelectedObject>();


      and using the boolean atributte for checkbox in the xhtml code:

      <rich:tree id="tree" switchType="client" value="#{permissaoUsuarioManagedBean.raiz}" var="node">
       <rich:treeNode icon="/../icons/unidade.gif" iconLeaf="/../icons/empresa.gif" >
       <h:selectBooleanCheckbox value="#{node.selected}"
       valueChangeListener="#{permissaoUsuarioManagedBean.eventControlarPermissao}"
       onclick="submit();">
       <f:param id="id" name="id" value="#{node.id}"/>
       </h:selectBooleanCheckbox>
       <h:outputText value="#{node.name}"/>
       </rich:treeNode>
       </rich:tree>


      I must show this component open if it's node was checked (true).

      Can i show this component open when the page is rendered?

      I didn't find any property in the treeNode component, is possible do it?