On Fri, Jan 9, 2009 at 11:31 PM, A Friend Of Yours <omer.akh...@gmail.com>wrote:

>
> In the case of MenuItem, I can use Command for the same purpose.
>
> MenuItem item = new MenuItem("Click Me", new Command() {
>    public void execute() {
>        // Do the navigation here
>        containerSimplePanel.setWidget(new SomeCompositeInheritedClass
> ());
>    }


> thanx, i understood everything. now what i am trying to do is use a single
Command() ref to resolve all menu item selections. but i am not able to
access the getSelectedItem() of MenuBar class inside the inner class for
command.

is there a workaround for this.??

*code:*
Command cmd = new Command() {
          public void execute() {
              if(menu.getSelectedItem() == aboutUsItem)
            decPanel.setWidget(new MenuData());
          }
};

MenuItem aboutUsItem = menu.addItem("About Us", cmd);



-- 
Sahil

--~--~---------~--~----~------------~-------~--~----~
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-Toolkit@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