I want to be able to call a method on a object dynamically. As in:
Method m = obj.getClass().getMethod(...);
m.invoke(...);
How would I do this on the client-side in GWT. I was trying to do
this:
reflectiveSet(trunk.getSettings().getCustName(), "value", "grumpy");
private native void reflectiveSet(Object obj, String property,
String value)/*-{
alert('o' +obj);
alert('p' +property);
alert('v' +value);
obj[property] = value;
}-*/;
but that doesn't work, I get this error:
com.google.gwt.core.client.JavaScriptException: (null): null
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
195)
Would this work if I were to actually deploy the war file?
--
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.