Hello again,

Please find the code below


In Page class:


                IColumn columns[] = new IColumn[] 
                {
                        new  PropertyTreeColumn(new 
ColumnLocation(Alignment.LEFT, 100,
Unit.PERCENT),"Check","userObject.name")
                        {
                                public IRenderable 
newCell(javax.swing.tree.TreeNode node, int level)
                                {
                                        return null;
                                }

                                public Component newCell(MarkupContainer 
parent,java.lang.String id,
javax.swing.tree.TreeNode node, int level)
                                {                                       
                                        CheckBoxPanel boxPanel = new 
CheckBoxPanel(parent.getId(),id);
                                        return boxPanel;
                                }
                        },
                };
                
                TreeDataProvider treedataProvider = new TreeDataProvider();
                trtTest = new
TreeTable("trtTest",treedataProvider.getTreeModel(),columns);
                trtTest.getTreeState().expandAll();
                
                add(trtTest); 



In Check box panel class:


public class CheckBoxPanel extends Panel
{
        private CheckBox cbxName;
        private Label lblName;
        private Link lnkName;
        
        public CheckBoxPanel(String id, String model) 
        {
                super(id);
                setMarkupId(id);
                setOutputMarkupId(true);
                setOutputMarkupPlaceholderTag(true);
                
                
                cbxName = new CheckBox("cbxName", new AbstractCheckBoxModel());
                add(cbxName);
       }
}



Tree Data Provider class:


public class TreeDataProvider 
{
        private DefaultMutableTreeNode dmtRoot;
        public TreeDataProvider()
        {
                dmtRoot = new DefaultMutableTreeNode(new TreeListVO("Test"));
                
                DefaultMutableTreeNode dmtBase1 = new DefaultMutableTreeNode(new
TreeListVO("Sakthi"));
                DefaultMutableTreeNode dmtChild1 = new 
DefaultMutableTreeNode(new
TreeListVO("Computer"));
                dmtBase1.add(dmtChild1);
                dmtRoot.add(dmtBase1);
        }
        
        public TreeModel getTreeModel()
        {
                DefaultTreeModel dtmTree = new DefaultTreeModel(dmtRoot);
                return dtmTree;
        }
}




In Model class:


public class TreeListVO 
{
        private String name;
                
        public TreeListVO(String name) 
        {
                this.name = name;
        }

        public String getName() 
        {
                return name;
        }
}



CheckBoxPanel & Page class have correspoding html file








-- 
View this message in context: 
http://old.nabble.com/Tree-table-with-check-box-tp26080852p26160113.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to