I am trying to开发者_运维百科 set a value to a variable defined in a javascript file from wicket.
Basically I want to pass the set the value of any variable to handlerAjax.getCallbackUrl() so that I could then use that variable in wicketAjaxGet
This will do it.
Wicket Page Component:
Label myScript = new Label("myScript", "url = '" + behave.getCallbackUrl() + "';");
myScript.setEscapeModelStrings(false);
add(myScript);
Add this in html header part
<script type="text/javascript" wicket:id="myScript"></script>
actual call:
var wcall = wicketAjaxGet(url + '', function() { }, function() { });
精彩评论