5 Replies Latest reply on Jul 11, 2007 2:52 PM by Edwin van der Elst

    checkBox in TreeNode

    Edwin van der Elst Newbie

      I am not sure if it is a richfaces or Seam question, so I double posted.

      I want to put a h:selectBooleanCheckbox in a treenode.
      The problem is, it shows up, but I can never select it.

      For a datatable, I use a bean with a Map<MyDataObject,Boolean> and a setSelection(MyDataObject) method in the (stafefull) bean. This works nicely, giving me a Map of selected objects.

      In the tree, my template looks like this:

      <rich:tree value="#{testMaintenance.testTree}" var="data" nodeFace="#{data.class.simpleName}" id="tree" switchType="client">
       <rich:treeNode id="tn" type="Test"><h:commandLink value="#{data.id}" action="#{testMaintenance.selectTest(data)}"/>
       </div> <h:selectBooleanCheckbox value="#{testMaintenance.selection[data]}"/> #{data.person.lastName} #{data.organisation.name}

      In my bean:
      public Map<Test, Boolean> getSelection() { return this.selection; }
      public void setSelection(Test t) {
       logger.info("check "+t.getId());

      If I put a h:inputText in the treenode, I can type into that field.
      This pattern works for DataTable. Has anyone tried this with a rich:Tree?