Hi Rob,

I think you got me a little bit wrong: I don't want the menu to handle
the logic. I can handle the logic my self. But I need to tell the menu
that it should show (paint) a menu item as disabled.

Give me a method like this and I am happy:

MenuItem.setEnabled (boolean enabled);

Well, the recommendation for gwtlib from Alan shows that this must be
implemented already. Then it must also be possible for me to do this
"by hand", without using an additional library. But how?

It would be fine if someone could tell how this can be done.

Thanks
Magnus



On Aug 3, 4:42 pm, Rob Coops <[email protected]> wrote:
> So what you are saying is that you need a way for the menu to detect which
> user/user group is looking at the menu.
>
> As you are already saying you have user groups it should not be to hard to
> inform the menu about the user group that is trying to open it. Once the
> menu knows which group is trying to open it it can use internal hard
> coded or externally read logic to decide what fields to render and how to
> render them, what events to attach to the elements and so on.
>
> I would simply hand the menu a variable/object that identifies the user
> group accessing it. Then the menu logic can deal with the rest. I would
> though use an external location to store the logic for the menu so you can
> easily update it should you need to add a new group in the future.
>
> I hope that helps a bit...
>
> On Tue, Aug 3, 2010 at 4:28 PM, Magnus <[email protected]> wrote:
> > Thank you,
>
> > but shouldn't GWT itself provide a mechanism to disable menu items?
>
> > Using an additional library is not the problem for me, but using an
> > additional library because of such a small functionality that should
> > be present in any menu implementation is a problem for me. As a
> > consequence I would end up in about a dozent libs...
>
> > Isn't there another solution?
>
> > Why is this missing?
>
> > Thanks
> > Magnus
>
> > On Aug 1, 10:56 pm, Alan Hadsell <[email protected]> wrote:
> > > On Aug 1, 12:25 pm, Magnus <[email protected]> wrote:
>
> > > > Hi,
>
> > > > I have a MenuBar with MenuItems, which I would like to selectively
> > > > enable for defined user groups. But how can I enable/disable menu
> > > > items?
>
> > > Take a look at gwtlib:http://code.google.com/p/gwtlib/.  It has
> > > menubars
> > > and menu items that can be enabled and disabled.
>
> > --
> > 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]<google-web-toolkit%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

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