Results 1 to 2 of 2

Thread: Treetable

  1. #1
    Marty is offline Member
    Join Date
    May 2007
    Posts
    38
    Rep Power
    0

    Default Treetable

    Hello!! I have another question....
    I am using a TreeTable to show information in a tree structure.

    The problem is in the jsp, the value of <t:tree> must be a DefaultTreeModel
    like this:


    Java Code:
    <t:tree id="tree" value="#{treeTable.treeModel}"
    
                                          var="treeItem"
    
                                          styleClass="tree"
    
                                        nodeClass="treenode"
    
                                        headerClass="treeHeader"
    
                                        footerClass="treeFooter"
    
                                              rowClasses="a, b"
    
                                              columnClasses="col1, col2"
    
                                        selectedNodeClass="treenodeSelected"
    
                                        expandRoot="false" >
    In TreeTable class I do the information search and create the tree.
    and after create the root element I have to assign the model:

    this.treeModel = new DefaultTreeModel(root);


    These instructions are in the TreeTable() constructor.

    the question is: Is necessary create the tree and assign to a DefaultTreeModel inside of the treetable() constructor?



    thanks you
    marty
    Last edited by Marty; 06-01-2007 at 04:29 PM.

  2. #2
    Alan is offline Member
    Join Date
    May 2007
    Posts
    39
    Rep Power
    0

    Default

    hello marty
    It is not necessary that you do it like this, the constructor can be even empty, the method that was executed is the one that returns the attribute that you have assigned to the tree (in your case treeModel in the class treeTable or getTreeModel). You can generate perfectly all your object in this method and it you were working correctly, allowing that your class should begin correctly.

    Regards,
    Alan
    Last edited by Alan; 06-01-2007 at 02:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •