Hi,
I defined an SelectionHandler to my tree, that will call a method of
my controller when the user clicks on a leaf. This part works fine. If
the user clicks on a node (with childs) the branch state (of folding)
should be changed.There encounters a problem: Clicking/Selecting a
leaf fires the event once, clicking on a folded (state false) node
fires the event once too. But if the branch is unfolded (state true)
the event is fired twice.
Is it an error in reasoning or does it still referres to the bug that
was fixed in Version 1.1.0?
I'm working with GWT Version 1.6.4
sourcecode looks like this:
public class NavigationView extends Composite implements
SelectionHandler<TreeItem> {
Panel panel = new VerticalPanel();
Tree tree = new Tree();
Navigation controller = new NavigationController();
public NavigationView(){
setDefaults();
panel.add(tree);
tree.addSelectionHandler(this);
initWidget(panel);
}
private void setDefaults(){
// Building the tree ...
}
public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem item = event.getSelectedItem();
if(item.getChildCount() == 0) {
Window.alert(item.getText());
//controller.selectionChanged(item);
}
else {
item.setState(!item.getState());
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---