IgorShare Thoughts and Ideas

Consulting and Training

Archive for April 28th, 2009

Tree event handler in GWT 1.6

Posted by Igor Moochnick on 04/28/2009

The documentation was a little sparse so, if you’d like to subscribe to the click events on the tree nodes you need to add a selection handler.

This is how you add a selection handler to the whole tree:

Tree optionsTree = new Tree();
optionsTree.addSelectionHandler(new SelectionHandler()
{
    @Override
    public void onSelection(SelectionEvent event)
    {
        Window.alert(event.getSelectedItem().getText());
    }
});
Advertisements

Posted in GWT, Java | 4 Comments »

 
%d bloggers like this: