P0ulBogd
P0ulBogd

Reputation: 77

Expand TreeItem in GWT

I wish that it would turn around TreeItem when you click on it and not on the "+". I added the following code:

Tree.addSelectionHandler(new SelectionHandler<TreeItem>() {

        @Override
        public void onSelection(SelectionEvent<TreeItem> event) {
            event.getSelectedItem().setState(!event.getSelectedItem().getState());
        }
    });

TreeItem expand but not collapsed, because onSelection activated twice.
What could be the reason for this?

Upvotes: 3

Views: 1078

Answers (1)

Related Questions