Author: ivaynberg
Date: Sat Jan 31 21:47:50 2009
New Revision: 739633
URL: http://svn.apache.org/viewvc?rev=739633&view=rev
Log:
WICKET-1855
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java?rev=739633&r1=739632&r2=739633&view=diff
==============================================================================
---
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
(original)
+++
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
Sat Jan 31 21:47:50 2009
@@ -27,37 +27,37 @@
/**
* A link that submits a form via ajax. Since this link takes the form as a
constructor argument it
* does not need to be inside form's component hierarchy.
- *
- * <p/> It works by splitting the javascript/Ajax calls from the normal
non-ajax requests by
- * generating:
- *
+ *
+ * <p/>
+ * It works by splitting the javascript/Ajax calls from the normal non-ajax
requests by generating:
+ *
* <pre>
* <a href="normal action url" onclick="ajax javascript
script; return
* false;">link</a>
* </pre>
- *
+ *
* 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
{...@link AjaxRequestTarget}.
- *
+ *
* If javascript is enabled, Wicket will send an ajax request, and process it
serverside with an
* {...@link AjaxRequestTarget} that is supplied to the server-side 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:
- *
+ *
* <pre>
* <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>
* </pre>
- *
+ *
* @since 1.2
- *
+ *
* @author Igor Vaynberg (ivaynberg)
*/
public abstract class AjaxSubmitLink extends AbstractSubmitLink
@@ -66,7 +66,7 @@
/**
* Construct.
- *
+ *
* @param id
*/
public AjaxSubmitLink(String id)
@@ -76,13 +76,13 @@
/**
* Construct.
- *
+ *
* @param id
* @param form
*/
public AjaxSubmitLink(String id, final Form form)
{
- super(id);
+ super(id, form);
add(new AjaxFormSubmitBehavior(form, "onclick")
{
@@ -124,7 +124,7 @@
/**
* Returns the {...@link IAjaxCallDecorator} that will be used to
modify the generated javascript.
* This is the preferred way of changing the javascript in the onclick
handler
- *
+ *
* @return call decorator used to modify the generated javascript or
null for none
*/
protected IAjaxCallDecorator getAjaxCallDecorator()
@@ -152,7 +152,7 @@
/**
* Final implementation of the Button's onSubmit. AjaxSubmitLinks have
there own onSubmit which
* is called.
- *
+ *
* @see org.apache.wicket.markup.html.form.Button#onSubmit()
*/
public final void onSubmit()
@@ -161,7 +161,7 @@
/**
* Listener method invoked on form submit
- *
+ *
* @param target
* @param form
*/
@@ -169,11 +169,11 @@
/**
* Listener method invoked on form submit with errors
- *
+ *
* @param target
* @param form
- *
- * TODO 1.3: Make abstract to be consistent with onsubmit()
+ *
+ * TODO 1.3: Make abstract to be consistent with onsubmit()
*/
protected void onError(AjaxRequestTarget target, Form form)
{