Michael Sparer wrote:
> 
> Generally you can get the callback-url of a wicket ajax-component with
> calling getCallbackUrl(), you should have a look at wicketAjaxGet which is
> part of wicket's JS library
> 
> 
> to make the whole stuff a bit more dynamic you could make a javascript
> template using wicketstuff-dojo, e.g.
> 
> function callWicket() {
>    var wcall = wicketAjaxGet('${url}' + addToUrl, function() { },
> function() { }); // addToUrl are optional parameters
> }
> 
> and then in the java-code
>               HashMap<String, String> map = new HashMap<String, String>();    
>         
>               map.put("url", getCallbackUrl().toString()); // getcallbackurl 
> is from
> AbstractAjaxBehavior
>               return new DojoPackagedTextTemplate(YourClass.class,
> "CometdDefaultBehaviorTemplate.js")
>                                               .asString(map);
> 
> and then add it in your responseheader (renderHead method) with
> response.renderJavaScript(...)
> 
> this may be not the easiest method but allows the most flexibility. 
> 
> hope that helps
> 
> Michael
> 

Hello Michael,

thank you for your answer. 

I have two little problems with this way:
- how can I get an instance of ResponseHeader from a WebPage?
- I need to use an AbstractAjaxBehavior, but where do I  need to add it?
Simply on the page? Or on my ShockwaveComponent?


Thank you ;)
-- 
View this message in context: 
http://www.nabble.com/Javascript-call-to-wicket-tp14685384p14689818.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to