UIObject#toString() is for debugging purposes only.  None of the event
listeners you've set up are included in that output.

The short of it is, you can't do what you're trying to do with the
stock MenuBar / MenuItem class.  I haven't done this myself, but I'm
pretty sure you could extend MenuItem without too much trouble to
support your use case since MenuBar doesn't appear to make any
assumptions about the DOM structure of MenuItem.

On Oct 10, 2:47 pm, divStar <[email protected]> wrote:
> Hello guys!
>
> I have a problem: I don't want to use GXT or any other library besides
> GWT itself and I am trying to accomplish something that seems to be
> difficult for some reason.
>
> I have a MenuBar which contains MenuItems. My MenuItem should display
> a checkbox, a text-field and a logout-button next to each other. This
> works as I am using a HorizontalPanel and adding widgets there.
>
> Image: [url=http://www.abload.de/image.php?
> img=odropaccountmenurc5p.jpg][img]http://www.abload.de/thumb/
> odropaccountmenurc5p.jpg[/img][/url]
>
> However:
>  - I want to be able to fire an event if the user presses the logout
> button (the item should be removed from the list)
>  - I want to be able to check whether the CheckBox is checked or not
> for every MenuItem
>
> Problem:
>  - MenuItem accepts Text or HTML as its label, but not a widget
>
> I can assign the widget's HTML to the MenuItem (using
> widget.toString()). But: the events are not handled anymore. I also
> have trouble sinking the ONCLICK-Event and overwriting OnBrowserEvent
> in the MenuBar-class, because I don't have the proper access to
> display submenus (openPopup is private).
>
> Is there any solution you guys would suggest in order to achieve that
> what I am trying to achieve? I wouldn't mind a custom widget, but I
> wouldn't like to reinvent the wheel. I also don't want to use a third-
> party library, because in most cases the GWT functionality is
> sufficent for what I am trying to do.
>
> Thank you in advance!

-- 
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