getSelectedItem is protected method. You can't access it unless you are extending MenuBar. So, it might not go that way. I guess you need a separate Command for each of the MenuItem.
On Jan 10, 12:11 am, "Sahil Dave" <[email protected]> wrote: > On Fri, Jan 9, 2009 at 11:31 PM, A Friend Of Yours > <[email protected]>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 [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 -~----------~----~----~----~------~----~------~--~---
