In an Ajax call you get a handle to the so-called ajax target.
The ajax target is used to ajax-update components ('to be updated via
an AJAX call').
So, roughly a non-ajax link is as follows:
page.add(new Link(xx));
An ajax link is as follows:
page.add(new AjaxLink(xx) {
@Override
onSubmit(Target target) {
... do your business logic here ...
// Finally, indicate which components you need to update via ajax:
target.addComponent(myAjaxUpdatePanelOrOtherComponent);
}
});
For a simple example, see
http://www.wicket-library.com/wicket-examples/ajax/form.2
**
Martin
2008/8/18 Gregg Bolinger <[EMAIL PROTECTED]>:
> I apologize if this question has been addressed before however I didn't find
> any thing doing a quick search. What is the recommended practice for
> handling HTML fragments from an AJAX response? For example, if I were doing
> something similar to jquery's load() or prototype's Updater() functions.
> Since in Wicket it seems that each WebPage class represents a single HTML
> page I'm having trouble wrapping my head around it. In an action based
> framework, like Stripes for example, I would simply have an event method
> forward to my JSP that is being returned for the ajax request. In Wicket,
> being a component model, I'm just not clear on the procedure.
>
> Take the Cheesr app from Wicket In Action, for example. In Chapter 3 a
> simple reusable cart component is made but it is plugged in and updated on a
> normal request/response (non AJAX). What would need to change for that
> WebPage/HTML to be updated via an AJAX call? Say if the Add link were
> clicked.
>
> Thanks.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]