Hello Todd, Thanks for your quick answer.
Yes I know I can do that, but that way, everytime that I want to
change the menu, I have to change the code, and thats what I want to
avoid.
I really want to do that because I'm starting a project, and I know
(by experience) that the menu will have a lot of changes.

But do you think that I souldn't use the client side solutions? Like
the "gwt-ent" and "gwt reflection" libraries? What is the problem with
them?

My last solution is to generate all the menu from the XML, and
interpret the actions with a client side function. Example, every
action like doAction("Home"). This solution is very likely yours, and
I get a semi-dynamic Menu.

Regards.

On Jun 3, 11:34 pm, Todd Seiber <[email protected]> wrote:
> You might want to avoid anything to do with reflection altogether. If
> you xml is something like this:
>
> <menuitems>
>   <menuitem>
>     <name>Button1</name>
>     <action>Widget1</action>
>   </menuitem>
>   <menuitem>
>     <name>Button2</name>
>     <action>Widget2</action>
>   </menuitem>
> </menuitem>
>
> Try something like
>
> if ("Widget1".equals(menuItem.getName())) {
>   horizontalPanel.add(new Widget1());} else if 
> ("Widget1".equals(menuItem.getName())) {
>
>   horizontalPanel.add(new Widget2());
>
> }
>
> Unless you have tons of Widgets this will be manageable. I believe
> this method may also help avoid issues with the -XdisableClassMetadata
> flag in the upcoming GWT 2.0.
>
> On Jun 3, 3:44 pm, ukrania <[email protected]> wrote:
>
> > Hello Everyone, I'm trying to make an Dynamic Menu in GWT, reading it
> > from an XML file. The XML file must have the button name and the
> > action (the composite associated that will be added to an Horizontal
> > Panel).
>
> > To make the action, a need to do Reflection of the Class, wish is
> > given me a lot of problems. I've tried 2 different solution, Client
> > Side and Server Side. On Client Side I've tried "gwt-ent" and "gwt
> > reflection" libraries, but I've got a lot of errors and its necessary
> > to set what Classes will be reflected (which I don't want because I
> > want a completely dynamic Menu, and not semi-dynamic). On Server Side,
> > I've tried to return the menu but its not possible to deal with client
> > side widgets on server side. So I tried to make the reflection and
> > return the instance to the client, but on server side its no possible
> > to get an client side Class.
>
> > Anyone knows other solution? I'm doing something wrong? How can I
> > reflect the class to put the Composite on the Horizontal Panel?
>
> > Thansk for your help. Regards.
--~--~---------~--~----~------------~-------~--~----~
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