Thanks a lot, but there are no comments or notes in the code and we cannot
see how to apply the example provided to our use case.
Let's say we create a class like this (notes are my understanding of what
each method is doing):
public class JSTest extends AbstractDefaultAjaxBehavior {
// Used to add Javacript to page ????
@Override
public void renderHead(IHeaderResponse response) {
response.renderOnDomReadyJavascript(
"function test() {return 'abcd' };");
}
// Used to call javascript and then return result ????
@Override
public final CharSequence getCallbackUrl(final boolean
onlyTargetActivePage) {
return super.getCallbackUrl(onlyTargetActivePage)
+ "&x='test()'";
}
// Used to get return value from request ????
@Override
protected void respond(AjaxRequestTarget target) {
Request request = RequestCycle.get().getRequest();
String x = request.getParameter("x");
System.out.println("value:"+x);
}
}
How would we then instantiate and call this class ???
Adding this in the constructor:
add( new JSTest())
Does nothing - would expect the print statement in respond() to be called.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Getting-Javascript-function-return-value-in-Wicket-tp3327794p3329321.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]