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



Pills wrote:
> 
> Hello guys,
> 
> I've a little question about the javascript and wicket. I need to update 
> some models on server side using javascript (in fact, I need to update 
> it from a flash object, and that's why I use js).
> 
> But I have no idea about how to do this... I know how to call a JS 
> function from flash, but I don't know how to update a wicket model using 
> a javascript/ajax call.
> 
> Has anybody some hint about that?
> 
> Thanks you
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Javascript-call-to-wicket-tp14685384p14688033.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