Friday, September 3, 2010

Re: How can I get a class by it's name and then construct it?

In that case it should be, generators are just like this function in
runAsync:

void getClass(String className){
if(className == "class1") new class1();
}

but a lot more complicated.
But thanks anyways.

On 3 ספטמבר, 17:00, Gal Dolber <gal.dol...@gmail.com> wrote:
> Thats not possible in GWT...
> Search in google for GWT Generators
>
> 2010/9/3 Shedokan <shedok...@gmail.com>
>
>
>
> > Hello,
> > I am trying to split my code and load classes by a name I get from the
> > server.
> > I tried using Class.forName("com.app.classes."+className) but GWT
> > doesn't support it.
>
> > How can I get a class and then construct it like this:
> > new (getClass("com.app.classes."+className))("Param1", "param2");
>
> > Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscribe@googlegroups.com<google-web-toolkit%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>
> http://code.google.com/p/guit/

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment