Hi!
I am having difficulty with Expanding and Folding the GWT Tree.
When user selects TreeItem with a mouse click I want the Tree to expand. And when user clicks on TreeItem again I want the Tree to Fold. The problem is that if I click on TreeItem when Tree is unfolded it Folds, and then immediately unfolds again. Looks like SelectionEvent is triggered twice
. Here is my code:
public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem t = event.getSelectedItem();
boolean isOpen = t.getState();
if(isOpen)
{
t.setState(false);
} else {
t.setState(true);
}
});
Please advise me...
Thank you.