class - How to create new instance dynamically in GWT? -


i have case, generate instance dynamically ie, have map

map<string,class> classmap=new hashmap<string,class>(); classmap.put("key1",panel.class); classmap.put("key2",panel1.class); classmap.put("key3",panel2.class); class clazz=map.get("key"); gwt.create(clazz); 

when compile using gwt compile got exception

compile -strict or -loglevel set trace or debug see errors.    [error] errors in 'com/asklepian/web/sample/sample.java'       [error] line 19: class literals may used arguments gwt.create() 

is there better way achieve same.thanks in advance

retrieving class objects done adding lowercase ".class" classname.
maybe change map
classmap.put("key1",panel.class);
classmap.put("key2",panel1.class);
classmap.put("key3",panel2.class);
, try recompile that.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -