I am using GWT and I have created a native method that calls the method cmd_addspace in the class EverlinkedActions and it works fine for now:
private static native String execute(String functionName, Object[] vParams)/*-{
try{
@es.gwt.client.dash.actions.impl.EverlinkedActions::cmd_addspace([Ljava/lanG/Object;)(vParams);
}catch(e){
alert(e.message);
}
}-*/;
How can i make the method name dynamic? it means instead of "cmd_addspace" i want to call the method "functionName" which its name is passed as argument in the native method.
And is their a way to make the class name also dynamic? i want to have something like that:
private static native String execute(String className, String functionName, Object[] vParams)/*-{
try{
@es.gwt.client.dash.actions.impl.className::functionName([Ljava/lanG/Object;)(vParams);
}catch(e){
alert(e.message);
}
}-*/;
Thanks for any help
Not sure what you're trying to actually achieve here but I'm afraid JSNI doesn't work like that.
Code such as @es.gwt.client.dash.actions.impl.EverlinkedActions::cmd_addspace([Ljava/lanG/Object;)(vParams); needs to be a fully resolvable symbol at compile time because class and method names get replaced with their minimised versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With