Added javadoc

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f5fae5ac
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f5fae5ac
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f5fae5ac

Branch: refs/heads/WICKET-6183
Commit: f5fae5ac2ed2a0a6e229fef81479062bf38ecfd8
Parents: 9221e61
Author: Andrea Del Bene <adelb...@apache.org>
Authored: Tue May 31 18:32:24 2016 +0200
Committer: Andrea Del Bene <adelb...@apache.org>
Committed: Tue May 31 18:32:24 2016 +0200

----------------------------------------------------------------------
 .../apache/wicket/ajax/AbstractDefaultAjaxBehavior.java |  2 +-
 .../org/apache/wicket/ajax/markup/html/AjaxLink.java    | 12 ++++++++++++
 .../wicket/ajax/markup/html/StatelessAjaxLink.java      | 10 ++++++++++
 .../apache/wicket/ajax/markup/html/form/AjaxButton.java |  6 ++++++
 .../wicket/ajax/markup/html/form/AjaxSubmitLink.java    |  7 +++++++
 .../ajax/markup/html/form/StatelessAjaxButton.java      | 11 ++++++++++-
 .../ajax/markup/html/form/StatelessAjaxSubmitLink.java  | 11 ++++++++++-
 wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc       |  2 +-
 8 files changed, 57 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
index 3766b98..b95d24c 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
@@ -88,7 +88,7 @@ public abstract class AbstractDefaultAjaxBehavior extends 
AbstractAjaxBehavior
                if (getStatelessHint(component))
                {
                        //generate behavior id
-               component.getBehaviorId(this);
+                       component.getBehaviorId(this);
                }
        }
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
index 359edd5..825c0f2 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/AjaxLink.java
@@ -16,6 +16,7 @@
  */
 package org.apache.wicket.ajax.markup.html;
 
+import org.apache.wicket.Component;
 import org.apache.wicket.IGenericComponent;
 import org.apache.wicket.ajax.AjaxEventBehavior;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -90,6 +91,12 @@ public abstract class AjaxLink<T> extends AbstractLink 
implements IAjaxLink, IGe
                                super.updateAjaxAttributes(attributes);
                                AjaxLink.this.updateAjaxAttributes(attributes);
                        }
+                       
+                       @Override
+                       public boolean getStatelessHint(Component component)
+                       {
+                               return AjaxLink.this.getStatelessHint();
+                       }
                };
        }
 
@@ -159,4 +166,9 @@ public abstract class AjaxLink<T> extends AbstractLink 
implements IAjaxLink, IGe
                setDefaultModelObject(object);
        }
 
+       @Override
+       protected boolean getStatelessHint()
+       {
+               return false;
+       }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/StatelessAjaxLink.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/StatelessAjaxLink.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/StatelessAjaxLink.java
index d083b23..d93c282 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/StatelessAjaxLink.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/StatelessAjaxLink.java
@@ -16,8 +16,18 @@
  */
 package org.apache.wicket.ajax.markup.html;
 
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
 import org.apache.wicket.model.IModel;
 
+/**
+ * Stateless version of {@link AjaxSubmitLink}. As such, it must not relay on 
+ * page status and must be provided with a static id (see user guide).
+ * 
+ * @author andrea del bene
+ *
+ * @param <T>
+ *            type of model object
+ */
 public abstract class StatelessAjaxLink<T> extends AjaxLink<T>
 {
        private static final long serialVersionUID = 5580337001313353237L;

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
index 83b5d8b..9a03463 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxButton.java
@@ -230,4 +230,10 @@ public abstract class AjaxButton extends Button
        protected void onError(AjaxRequestTarget target, Form<?> form)
        {
        }
+       
+       @Override
+       protected boolean getStatelessHint()
+       {
+               return false;
+       }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
index b1bf987..f032552 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/AjaxSubmitLink.java
@@ -219,4 +219,11 @@ public abstract class AjaxSubmitLink extends 
AbstractSubmitLink
        {
                logger.warn("unexpected invocation of #onAfterSubmit() on {}", 
this);
        }
+       
+       
+       @Override
+       protected boolean getStatelessHint()
+       {
+               return false;
+       }
 }

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxButton.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxButton.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxButton.java
index 7e3c4af..43e825f 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxButton.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxButton.java
@@ -19,7 +19,16 @@ package org.apache.wicket.ajax.markup.html.form;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.model.IModel;
 
-public class StatelessAjaxButton extends AjaxButton
+/**
+ * Stateless version of {@link AjaxButton}. As such, it must not relay on 
+ * page status and must be provided with a static id (see user guide).
+ * 
+ * @author andrea del bene
+ *
+ * @param <T>
+ *            type of model object
+ */
+public abstract class StatelessAjaxButton extends AjaxButton
 {
        private static final long serialVersionUID = -3625309953596700148L;
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxSubmitLink.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxSubmitLink.java
 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxSubmitLink.java
index bd710fb..13601ec 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxSubmitLink.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/form/StatelessAjaxSubmitLink.java
@@ -18,7 +18,16 @@ package org.apache.wicket.ajax.markup.html.form;
 
 import org.apache.wicket.markup.html.form.Form;
 
-public class StatelessAjaxSubmitLink extends AjaxSubmitLink
+/**
+ * Stateless version of {@link AjaxSubmitLink}. As such, it must not relay on 
+ * page status and must be provided with a static id (see user guide).
+ * 
+ * @author andrea del bene
+ *
+ * @param <T>
+ *            type of model object
+ */
+public abstract class StatelessAjaxSubmitLink extends AjaxSubmitLink
 {
        private static final long serialVersionUID = -3175689678864002395L;
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/f5fae5ac/wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc 
b/wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc
index e23f5c5..47f9c98 100644
--- a/wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc
+++ b/wicket-user-guide/src/docs/guide/ajax/ajax_7.gdoc
@@ -38,7 +38,7 @@ However in this case calling @setOutputMarkupId@ on a 
component is not enough. S
 By default calling @setOutputMarkupId@ we generate markup ids using a 
session-level counter and this make them not static. Hence, to refresh 
component in a stateless page we must provide them with static ids, either 
setting them in Java code (with @Component.setMarkupId@) or simply writing them 
directly in the markup:
 
 {code}
-   <span id="staticIdToUSe" wicket:id="componentWicketId"></span>
+   <span id="staticIdToUse" wicket:id="componentWicketId"></span>
 {code}
 
 [See examples site|http://examples7x.wicket.apache.org/stateless] for a full 
showcase of AJAX-stateless capabilities.

Reply via email to