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
, try recompile that.
classmap.put("key1",panel.class);
classmap.put("key2",panel1.class);
classmap.put("key3",panel2.class);
Comments
Post a Comment