Hi all,

I spend 2 hours searching for a way to get the SelectionHandler to
work but it fails...
Can you please help me out??

Here is my code that I use:

@Override public void onModuleLoad()
  {
    // Create a tree with a few items in it.

    aItem.addItem("Item 1");
    aItem.addItem("Item 2");
    aItem.addItem("Item 3");


    // define aTree and add the root item to it
    Tree aTree = new Tree();
    aTree.addItem(aItem);

    // create Split Layout
    SplitLayoutPanel p = new SplitLayoutPanel();

    // add SplitLayout to RootPanel
    RootLayoutPanel.get().add(p);

    // define the SplitLayout components
    p.addWest(aTree, 200);
    p.addNorth(new HTML("list"), 384);
    p.add(new HTML("list"));

    // add ItemListener
    aTree.addSelectionHandler(new SelectionHandler<TreeItem>()
      {
        @Override public void onSelection(SelectionEvent<TreeItem>
aEvent)
        {
          if (aEvent.getSelectedItem().equals("Configured Solutions"))
          {
            Window.alert("Hello Adis");
          }
        }
      });

/*    aTree.addSelectionHandler(new SelectionHandler<TreeItem>()
      {
        @Override public void onSelection(SelectionEvent<TreeItem>
event)
        {
          Window.alert("Hello SB");
        }
      });*/
  }

Thanks for your input!
Regards,
SB

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to