Hi Jake,

I think your problem is here:

tree.addTreeListener(new TreeListener(){
     public void onTreeItemSelected(TreeItem item) {
          ThirdMenu neo = new ThirdMenu(item.getText()); <<<< won't
work
     }
      public void onTreeItemStateChanged(TreeItem item) {
        if (item.getState()){
            //  currChapter.setText(item.getText());
        }
     }

You have attached a first instance of ThirdMenu to outer where it
remains. You have instantiated a second instance of ThirdMenu but you
have not attached it to outer (or anything else), so it does not get
displayed. When you write Widget.add(Widget someWidget) you are
effectively attaching it to the DOM behind the scenes (starting off
with RootPanel.get.add(..)). To make it do so you would need to write:

     public void onTreeItemSelected(TreeItem item) {
          ThirdMenu neo = new ThirdMenu(item.getText());
          outer.remove(new1);
          outer.add(neo,DockPanel.CENTER);
     }

Arguably a better strategy would be to make ThirdMenu a mutable and
update the same instance from the listener. If ThirdMenu was a Tree,
for example, you would probably have a method to build it in the first
place from some parameter. Then you can call Tree.clear() followed by
the build method when you need to update ThirdMenu. Also if you have
ThirdMenu implement TreeListener then it can be registered with
SecondMenu and therefore be notified of SecondMenu selections via the
Event model which is generally the best way to do it as it decouples
Second- and ThirdMenu.

regards
gregor

On Nov 25, 10:07 am, jake H <[EMAIL PROTECTED]> wrote:
> I m certain that is possible to do sth like that with Dockpanels.
> Any one that can help?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to