click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r956362 - in /click/trunk/click: documentation/xdocs/src/docbook/click/ examples/src/org/apache/click/examples/control/ examples/src/org/apache/click/examples/page/control/ examples/src/org/apache/click/examples/page/form/ examples/src/org/...
Date Sun, 20 Jun 2010 14:18:30 GMT
Author: sabob
Date: Sun Jun 20 14:18:29 2010
New Revision: 956362

URL: http://svn.apache.org/viewvc?rev=956362&view=rev
Log:
don't use 'submit' as the name of fields since it creates errors when using JS, especially
when submitting forms

Modified:
    click/trunk/click/documentation/xdocs/src/docbook/click/chapter-controls.xml
    click/trunk/click/examples/src/org/apache/click/examples/control/ClientPanel.java
    click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/form/StandardControlsForm.java
    click/trunk/click/examples/src/org/apache/click/examples/page/general/ControlHeadDemo.java
    click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java
    click/trunk/click/framework/test/org/apache/click/ClickServletTest.java
    click/trunk/click/framework/test/org/apache/click/pages/ListenerPage.java

Modified: click/trunk/click/documentation/xdocs/src/docbook/click/chapter-controls.xml
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-controls.xml?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/documentation/xdocs/src/docbook/click/chapter-controls.xml (original)
+++ click/trunk/click/documentation/xdocs/src/docbook/click/chapter-controls.xml Sun Jun 20
14:18:29 2010
@@ -790,7 +790,7 @@ public EmployeePage extends Page {
         form.add(new DoubleField("salary"));
 
         // Add a submit button to form
-        form.add(new Submit("submit", "Add Employee"));
+        form.add(new Submit("add", "Add Employee"));
 
         // Add form the page
         addControl(form);
@@ -984,7 +984,7 @@ public class EmployeePage extends Page {
         addTextField("salary", "Salary:", list);
 
         // Add a submit button to form
-        form.add(new Submit("submit", "Add Employee"));
+        form.add(new Submit("add", "Add Employee"));
 
         // Add the form to the page
         addControl(form);
@@ -1046,7 +1046,7 @@ public class EmployeePage extends Page {
             <input type="text" name="salary" id="form_salary" value="" size="20"/>
         </li>
     </ol>
-    <input type="submit" name="submit" id="form_submit" value="Add Employee"/>
+    <input type="submit" name="add" id="form_add" value="Add Employee"/>
 &lt;/form&gt;</programlisting>
 
       <para>Again using a CSS stylesheet, the markup above can be styled and

Modified: click/trunk/click/examples/src/org/apache/click/examples/control/ClientPanel.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/control/ClientPanel.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/control/ClientPanel.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/control/ClientPanel.java Sun
Jun 20 14:18:29 2010
@@ -38,12 +38,13 @@ public class ClientPanel extends Panel {
         super(name);
     }
 
+    @Override
     public void onInit() {
         form.add(new TextField("name")).setRequired(true);
         form.add(new DateField("dateJoined"));
         form.add(new DoubleField("holdings"));
 
-        form.add(new Submit("submit", this, "onSubmit"));
+        form.add(new Submit("save", this, "onSave"));
         form.add(new Submit("cancel", this, "onCancel"));
 
         add(form);
@@ -54,7 +55,7 @@ public class ClientPanel extends Panel {
         super.onInit();
     }
 
-    public boolean onSubmit() {
+    public boolean onSave() {
         if (form.isValid()) {
             // In real app one would store client in database
             addModel("msg", "Successfully created new Client: '"

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
Sun Jun 20 14:18:29 2010
@@ -61,7 +61,7 @@ public class SubmitLinkDemo extends Bord
 
     public void demo1() {
         // Create a submit link.
-        final SubmitLink submitLink = new SubmitLink("submit");
+        final SubmitLink submitLink = new SubmitLink("save");
 
         Form form = new Form("demo1");
         addControl(form);

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/form/StandardControlsForm.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/form/StandardControlsForm.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/form/StandardControlsForm.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/form/StandardControlsForm.java
Sun Jun 20 14:18:29 2010
@@ -108,7 +108,7 @@ public class StandardControlsForm extend
         imageSubmit.setTitle("ImageSubmit");
         form.add(imageSubmit);
         form.add(new Reset("reset"));
-        form.add(new Submit("submit"));
+        form.add(new Submit("save"));
 
         // Settings Form
         fieldSet = new FieldSet("options", "Form Options");

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/general/ControlHeadDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/general/ControlHeadDemo.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/general/ControlHeadDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/general/ControlHeadDemo.java
Sun Jun 20 14:18:29 2010
@@ -44,7 +44,7 @@ public class ControlHeadDemo extends Bor
         StarRating rating = new StarRating("rating", 5, 2);
         form.add(rating);
 
-        form.add(new Submit("submit"));
+        form.add(new Submit("save"));
 
         addControl(form);
     }

Modified: click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java Sun Jun 20
14:18:29 2010
@@ -71,7 +71,7 @@ import org.apache.commons.lang.ArrayUtil
  *         Tree tree = createTree();
  *         form.add(tree);
  *
- *         submit = new Submit("submit", this, "onSubmitClick");
+ *         submit = new Submit("save", this, "onSubmitClick");
  *         cancel = new Submit("cancel", this, "onCancelClick");
  *
  *         form.add(submit);
@@ -254,7 +254,7 @@ public class CheckboxTree extends Tree {
      *     }
      *     Form form = createForm();
      *     form.add(tree);
-     *     Submit submit = new Submit("submit");
+     *     Submit submit = new Submit("save");
      *     form.add(submit);
      *     submit.setActionListener(new ActionListener() {
      *         public boolean onAction(Control source) {

Modified: click/trunk/click/framework/test/org/apache/click/ClickServletTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/ClickServletTest.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/ClickServletTest.java (original)
+++ click/trunk/click/framework/test/org/apache/click/ClickServletTest.java Sun Jun 20 14:18:29
2010
@@ -39,7 +39,7 @@ public class ClickServletTest extends Te
         MockContainer container = new MockContainer("web");
         container.start();
         container.setParameter(Form.FORM_NAME, "form"); // Simulate form submitted
-        container.setParameter("submit", "submit"); // Simulate Submit button clicked
+        container.setParameter("save", "save"); // Simulate Submit button clicked
         container.setParameter("field", "one"); // Simulate TextField value set
 
         ListenerPage page = (ListenerPage) container.testPage(ListenerPage.class);

Modified: click/trunk/click/framework/test/org/apache/click/pages/ListenerPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/pages/ListenerPage.java?rev=956362&r1=956361&r2=956362&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/pages/ListenerPage.java (original)
+++ click/trunk/click/framework/test/org/apache/click/pages/ListenerPage.java Sun Jun 20 14:18:29
2010
@@ -40,10 +40,11 @@ public class ListenerPage extends Page {
     /**
      * Initialize page.
      */
+    @Override
     public void onInit() {
 
         // Create and add submit button *before* adding the textField
-        Submit submit = new Submit("submit");
+        Submit submit = new Submit("save");
         form.add(submit);
 
         // Add listener on submit button



Mime
View raw message