You add a single column to your tree. But you overlay the default cell
component by the checkboxpanel.
So you don't get all the stuff from parent component (Like link and node
icon etc).
Check TreeTable.TreeFragment for details.
You have two opportunities:
1. If you want to add your checkbox directly beside the tree structure
components you have to copy the code from the treetable class
2. If you only want the treestructure in one column (with a link label)
and the combobox in the second column then you have to add
another column on which you don't overwrite newCell (see below)
HTH
Per
public class HomePage extends WebPage {
private final TreeTable trtTest;
/**
* Constructor that is invoked when page is invoked without a session.
*
* @param parameters
* Page parameters
*/
public HomePage(final PageParameters parameters) {
IColumn columns[] = new IColumn[] { col1(), col2() };
TreeDataProvider treedataProvider = new TreeDataProvider();
trtTest = new TreeTable("trtTest", treedataProvider.getTreeModel(),
columns);
trtTest.getTreeState().expandAll();
add(trtTest);
}
private PropertyTreeColumn col1() {
return new PropertyTreeColumn(new
ColumnLocation(Alignment.MIDDLE, 5,
Unit.PROPORTIONAL), "Check", "userObject.name");
}
private PropertyTreeColumn col2() {
return new PropertyTreeColumn(new ColumnLocation(Alignment.LEFT,
7, Unit.EM), "L2",
"userObject.name") {
@Override
public Component newCell(MarkupContainer parent, String id,
TreeNode node, int level) {
DefaultMutableTreeNode n = (DefaultMutableTreeNode) node;
CheckBoxPanel boxPanel = new CheckBoxPanel(parent.getId(), n
.getUserObject());
return boxPanel;
}
};
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org