Hi!

I'm developing GWT/GWT-Ext application.
For this, i created a simple "framework" for control de flow of the
application.
In this control, i want send to client (from the servlet) a name of
form (gwt-ext Panel) to show in the screen.
But, GWT don't support reflection... then i create a "FormFactory":

public class FormFactory {

    public Panel getForm(String name) {
         if (name.equals("com.app.client.forms.FormClient")) return
new com.app.client.forms.FormClient();

        ... others if, one for form of app...

   }
}

This works fine, but is dont elegant...
I think in create form dynamically... then I read about JSNI.

My method change for this:

    pubilic native Panel getForm(String name)/*-{
       return @com.app.client.forms.FormClient::new()();
    }-*/;


And this works fine! But, i write a fix code...
Now, i change my method for:

   public native Panel getForm(String name)/*-{
       return eval('@' + name + '::new()()');
    }-*/;


And this dont work!
Firebug register this error:

 "reference to undefined XML name @com"


Sorry my bad english, and thank 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