click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r956365 - in /click/trunk/click/examples: src/org/apache/click/examples/page/form/FormProperties.java webapp/form-head.htm
Date Sun, 20 Jun 2010 14:40:16 GMT
Author: sabob
Date: Sun Jun 20 14:40:15 2010
New Revision: 956365

URL: http://svn.apache.org/viewvc?rev=956365&view=rev
Log:
removed example dependency on Form name

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/form/FormProperties.java
    click/trunk/click/examples/webapp/form-head.htm

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/form/FormProperties.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/form/FormProperties.java?rev=956365&r1=956364&r2=956365&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/form/FormProperties.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/form/FormProperties.java
Sun Jun 20 14:40:15 2010
@@ -143,77 +143,77 @@ public class FormProperties extends Bord
         buttonAlignSelect = new Select("buttonAlign");
         buttonAlignSelect.addAll(new String[] { "left", "center", "right" });
         buttonAlignSelect.setTitle("Buttons horizontal alignment");
-        buttonAlignSelect.setAttribute("onchange", "optionsForm.submit();");
+        buttonAlignSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(buttonAlignSelect);
 
         columnsSelect = new Select("columns");
         columnsSelect.addAll(new String[] { "1", "2", "3", "4" });
         columnsSelect.setTitle("Number of Form table columns");
-        columnsSelect.setAttribute("onchange", "optionsForm.submit();");
+        columnsSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(columnsSelect);
 
         buttonStyle = new TextField("buttonStyle");
         buttonStyle.setTitle("Button td style attribute");
-        buttonStyle.setAttribute("onchange", "optionsForm.submit();");
+        buttonStyle.setAttribute("onchange", "form.submit();");
         fieldSet.add(buttonStyle);
 
         errorsAlignSelect = new Select("errorsAlign");
         errorsAlignSelect.addAll(new String[] { "left", "center", "right" });
         errorsAlignSelect.setTitle("Errors block horizontal alignment");
-        errorsAlignSelect.setAttribute("onchange", "optionsForm.submit();");
+        errorsAlignSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(errorsAlignSelect);
 
         errorsPositionSelect = new Select("errorsPosition");
         errorsPositionSelect.addAll(new String[] { "top", "middle", "bottom" });
         errorsPositionSelect.setTitle("Form errors position");
-        errorsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
+        errorsPositionSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(errorsPositionSelect);
 
         errorsStyle = new TextField("errorsStyle");
         errorsStyle.setTitle("Errors td style attribute");
-        errorsStyle.setAttribute("onchange", "optionsForm.submit();");
+        errorsStyle.setAttribute("onchange", "form.submit();");
         fieldSet.add(errorsStyle);
 
         labelAlignSelect = new Select("labelAlign");
         labelAlignSelect.addAll(new String[] { "left", "center", "right" });
         labelAlignSelect.setTitle("Field label alignment");
-        labelAlignSelect.setAttribute("onchange", "optionsForm.submit();");
+        labelAlignSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(labelAlignSelect);
 
         labelsPositionSelect = new Select("labelsPosition");
         labelsPositionSelect.addAll(new String[] {"left", "top"});
         labelsPositionSelect.setTitle("Form labels position");
-        labelsPositionSelect.setAttribute("onchange", "optionsForm.submit();");
+        labelsPositionSelect.setAttribute("onchange", "form.submit();");
         fieldSet.add(labelsPositionSelect);
 
         labelStyle = new TextField("labelStyle");
         labelStyle.setTitle("Label td style attribute");
-        labelStyle.setAttribute("onchange", "optionsForm.submit();");
+        labelStyle.setAttribute("onchange", "form.submit();");
         fieldSet.add(labelStyle);
 
         disabledCheckbox = new Checkbox("disabled");
-        disabledCheckbox.setAttribute("onclick", "optionsForm.submit();");
+        disabledCheckbox.setAttribute("onclick", "form.submit();");
         fieldSet.add(disabledCheckbox);
 
         readonlyCheckbox = new Checkbox("readonly");
-        readonlyCheckbox.setAttribute("onclick", "optionsForm.submit();");
+        readonlyCheckbox.setAttribute("onclick", "form.submit();");
         fieldSet.add(readonlyCheckbox);
 
         fieldStyle = new TextField("fieldStyle");
         fieldStyle.setTitle("Field td style attribute");
-        fieldStyle.setAttribute("onchange", "optionsForm.submit();");
+        fieldStyle.setAttribute("onchange", "form.submit();");
         fieldSet.add(fieldStyle);
 
         validateCheckbox = new Checkbox("validate");
-        validateCheckbox.setAttribute("onclick", "optionsForm.submit();");
+        validateCheckbox.setAttribute("onclick", "form.submit();");
         fieldSet.add(validateCheckbox);
 
         javaScriptValidateCheckbox = new Checkbox("javaScriptValidate", "JavaScript Validate");
-        javaScriptValidateCheckbox.setAttribute("onclick", "optionsForm.submit();");
+        javaScriptValidateCheckbox.setAttribute("onclick", "form.submit();");
         fieldSet.add(javaScriptValidateCheckbox);
 
         showBordersCheckbox = new Checkbox("showBorders");
-        showBordersCheckbox.setAttribute("onclick", "optionsForm.submit();");
+        showBordersCheckbox.setAttribute("onclick", "form.submit();");
         fieldSet.add(showBordersCheckbox);
 
         optionsForm.add(new Submit("restoreDefaults", this, "onRestoreDefaults"));

Modified: click/trunk/click/examples/webapp/form-head.htm
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/form-head.htm?rev=956365&r1=956364&r2=956365&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/form-head.htm (original)
+++ click/trunk/click/examples/webapp/form-head.htm Sun Jun 20 14:40:15 2010
@@ -1,4 +1,3 @@
-<!--
 #* Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
@@ -15,9 +14,9 @@
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.*#
--->
 
-function toggleBorders(checkbox) {
+function toggleBorders(checkboxId) {
+  var checkbox = document.getElementById(checkboxId);
   var formTable = document.getElementById("form-form");
   var fieldsTable = document.getElementById("form-fields");
   var buttonsTable = document.getElementById("form-buttons");
@@ -38,7 +37,8 @@ function toggleBorders(checkbox) {
       errorsTable.style.border = "0px dashed red";
     }
   }
-  document.optionsForm.showBorders.value = checkbox.checked;
+  var optionsForm = document.getElementById("optionsForm");
+  optionsForm.showBorders.value = checkbox.checked;
 }
 
-toggleBorders(document.optionsForm.showBorders);
\ No newline at end of file
+toggleBorders("optionsForm_showBorders");
\ No newline at end of file



Mime
View raw message