You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vladimir Kovalyuk <ko...@gmail.com> on 2009/06/09 09:23:24 UTC

Is inversion of selection of tree item a reasonable default behavior?

When in multiple selection mode it makes sense to inverse the selection
state of tree item when user clicks on link of LinkIconPanel.
But in single selection mode it is not an expected behavior. At least in MS
Windows environment.

Please consider the following implementation:

LinkIconPanel {
...
    protected void onNodeLinkClicked(Object node, BaseTree tree,
AjaxRequestTarget target)
    {
        tree.getTreeState().selectNode(node,
!tree.getTreeState().isNodeSelected(node) ||
!tree.getTreeState().isAllowSelectMultiple());
        tree.updateTree(target);
    }
...
}