click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1036415 - in /click/trunk/click: extras/src/org/apache/click/extras/control/SubmitLink.java framework/src/org/apache/click/control/Form.java
Date Thu, 18 Nov 2010 11:26:26 GMT
Author: sabob
Date: Thu Nov 18 11:26:25 2010
New Revision: 1036415

URL: http://svn.apache.org/viewvc?rev=1036415&view=rev
Log:
make server-side and client-side validation independent. CLK-730

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
    click/trunk/click/framework/src/org/apache/click/control/Form.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java?rev=1036415&r1=1036414&r2=1036415&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java Thu Nov 18
11:26:25 2010
@@ -326,7 +326,7 @@ public class SubmitLink extends ActionLi
 
         HtmlStringBuffer buffer = new HtmlStringBuffer(60);
         buffer.append("return");
-        if (getForm().getValidate() && getForm().isJavaScriptValidation()) {
+        if (getForm().isJavaScriptValidation()) {
             buffer.append(" on_");
             buffer.append(getForm().getId());
             buffer.append("_submit() &&");
@@ -484,9 +484,9 @@ public class SubmitLink extends ActionLi
 
         // Check that the link is attached to a Form and the onClick attribute
         // has not been set
-        Form form = getForm();
-        if (form != null && getOnClick() == null) {
-            setOnClick(getSubmitScript(form.getId()));
+        Form localForm = getForm();
+        if (localForm != null && getOnClick() == null) {
+            setOnClick(getSubmitScript(localForm.getId()));
         }
 
         super.render(buffer);

Modified: click/trunk/click/framework/src/org/apache/click/control/Form.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/Form.java?rev=1036415&r1=1036414&r2=1036415&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/Form.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/Form.java Thu Nov 18 11:26:25
2010
@@ -2822,7 +2822,9 @@ public class Form extends AbstractContai
 
         // Reset bypass flag to ensure it does not influence the validate flag
         bypassValidation = Boolean.FALSE;
-        if (getValidate() && isJavaScriptValidation()) {
+
+        // Render JavaScript form validation code
+        if (isJavaScriptValidation()) {
             buffer.append("<tr style=\"display:none\" id=\"");
             buffer.append(getId());
             buffer.append("-errorsTr\"><td width='100%' align=\"");
@@ -2947,7 +2949,7 @@ public class Form extends AbstractContai
         bypassValidation = Boolean.FALSE;
 
         // Render JavaScript form validation code
-        if (getValidate() && isJavaScriptValidation()) {
+        if (isJavaScriptValidation()) {
             List<String> functionNames = new ArrayList<String>();
 
             buffer.append("<script type=\"text/javascript\"><!--\n");



Mime
View raw message