On Wed, Oct 10, 2012 at 8:35 AM, JamesXWang <[email protected]> wrote: > Hi Martin, > > Thank you very much for your help! > > I think renderHead(HtmlHeaderContainer container) can still work because > when I view the source of the UI the js have already been rendered and the > function callWicket() can get those js vars. But anyway I've changed to the > new api you suggested. > > I found a cause is that when I upgrade I only change wicketAjaxGet to > Wicket.Ajax.Get like below, > > var wcall = wicketAjaxGet(fliedBookListenerUrl, function() { > //logic here. > }.bind(this), function() { }.bind(this)); > > Now I've changed it again to - > > var wcall = Wicket.Ajax.get({"u":fliedBookListenerUrl}, function() { > //logic here. > }.bind(this), function() { }.bind(this)); > > then it can get into the respond() method of fliedBookListener = new > AbstractDefaultAjaxBehavior() { > @Override > protected void respond(final AjaxRequestTarget target) {...} } > > But the problem is that after the java logic ajax call can't return to the > function() in > > var wcall = Wicket.Ajax.get({"u":fliedBookListenerUrl}, function() { > //logic here. > }.bind(this), function() { }.bind(this));
Yes, it is wrong. As described at https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax now Wicket.Ajax.(get|post) methods accept a JavaScript object with the configuration. So, it should be: Wicket.Ajax.get({u: theUrl, sh: [successHandlerFunction1, successHandlerFunction2]}) > > Did I did sth wrong in calling Wicket.Ajax.get() ? > > BR, > James > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/the-Wicket-Ajax-get-AbstractDefaultAjaxBehavior-can-t-work-on-v6-1-0-I-worked-well-in-v1-5-6-at-befo-tp4652813p4652819.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] > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
