On 9/9/07, Craig Lenzen <[EMAIL PROTECTED]> wrote:
>
> I have to admit that I don't fully understand the ajaxfallback components,
They work by splitting the javascript/Ajax calls from the normal
non-ajax requests by generating:
<a href="normal action url" onclick="ajax javascript script; return
false;">link</a>
If/when javascript is turned off in the browser, or it doesn't support
javascript, then the browser will not respond to the onclick event,
using the href directly. Wicket will then use a normal request target,
and call the serverside onclick with a null AjaxRequestTarget.
If javascript is enabled, wicket will send an ajax request, and
process it serverside with an AjaxRequestTarget, that is supplied to
the serverside onclick method. The "return false" in the <a href>
onclick handler ensures the browser doesn't perform the normal request
too.
The latter is nicely illustrated with this:
<a href="javascript:alert('href event handler');"
onclick="alert('onclick event handler');">clicking me gives two
alerts</a>
<a href="javascript:alert('href event handler');"
onclick="alert('onclick event handler');return false;">clicking me
gives only one alert</a>
Martijn
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]