You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by mlabs <ml...@gmail.com> on 2012/07/18 01:32:14 UTC

wicket ajax question

I have a panel with some content.
It has an AjaxLink that I use to refresh the panel. In the onclick handler I
refresh the content and target.add(component..) .. that all works great...
but I want to do it another way.

I add an AbstractAjaxBehavior to the panel, because I want to make ajax
calls to it from the client.

I override renderHead() to put some JS in the client header that I can use
later to call back to my panel - it is a JS object with a function that sets
up a $.ajax() call using the callbackURL of my behavior...

I override onRequest() to catch the incoming ajax call... sure enough it
gets hit in the debugger...
I do my internal refresh of my panel's model ...
Now I need to get it to re-render.. the AjaxLink did this via
target.add(..component), so I figured I would get myself an
AjaxRequestTarget and do the same:
WebApplication app = (WebApplication)getComponent().getApplication();
AjaxRequestTarget target =
app.newAjaxRequestTarget(getComponent().getPage());

... then target.add(..component..) as before...

however this time the panel doesn't appear to redraw...

what am I missing?
TIA



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-ajax-question-tp4650579.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket ajax question

Posted by mlabs <ml...@gmail.com>.
the problem was that i wasn't passing the target back as the response..
found it better to reuse the wicket ajax stuff when it comes to updating
wicket panels...

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/wicket-ajax-question-tp4650579p4650583.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org