struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-600) Enable Client-side validation for visitor validations
Date Fri, 24 May 2013 12:58:21 GMT

    [ https://issues.apache.org/jira/browse/WW-600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666272#comment-13666272
] 

Hudson commented on WW-600:
---------------------------

Integrated in Struts2-JDK6 #712 (See [https://builds.apache.org/job/Struts2-JDK6/712/])
    WW-600 Enables Client-side validation for visitor validations (Revision 1485978)

     Result = SUCCESS
lukaszlenart : 
Files : 
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Form.java
* /struts/struts2/trunk/core/src/main/resources/template/xhtml/form-close-validate.ftl
* /struts/struts2/trunk/core/src/test/java/org/apache/struts2/components/FormTest.java
* /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Formtag-2.txt
* /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Formtag-22.txt
* /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Formtag-24.txt

                
> Enable Client-side validation for visitor validations
> -----------------------------------------------------
>
>                 Key: WW-600
>                 URL: https://issues.apache.org/jira/browse/WW-600
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: XML Validators
>    Affects Versions: WW 2.1
>         Environment: JDK 1.4.2, Tomcat 5.0.27, WebWork CVS (20040721)
>            Reporter: Matt Raible
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.15
>
>         Attachments: ASF.LICENSE.NOT.GRANTED--visitor_validator.patch, visitor_validator.patch
>
>
> The client-side JavaScript doesn't work as advertised on:
> http://wiki.opensymphony.com/display/WW/Client-Side+Validation
> I have the following form:
> <ww:form action="'saveUser'" validate="true" cssClass="'detail'" method="'post'">
> This generates the following onsubmit handler:
> onsubmit="return(${parameters.name}_validate())" 
> And the following JavaScript after the form:
> <script type="text/javascript">
>     function ${parameters.name}_validate() {
>         var form = document.forms['${parameters.name}'];
>         var focus = ${parameters.name}_validate_actual();
>         if (focus != null) {
>             form.elements[focus].focus();
>             if (form.elements[focus].type == 'text' || form.elements[focus].type == 'textarea')
{
>                 form.elements[focus].select();            
>             }
>             return false;
>         } else {
>             return true;
>         }
>     }
>     function ${parameters.name}_validate_actual() {
>         var form = document.forms['${parameters.name}'];
>         // cannot find any applicable validators
>         return null;
>     }
>     </script>
> If I add name="'user'" to the <ww:form>, then the JavaScript looks right, but I
get:
>     function user_validate_actual() {
>         var form = document.forms['user'];
>         // cannot find any applicable validators
>         return null;
>     }
> I have the following in validators.xml:
>    <validator name="requiredstring"
>         class="com.opensymphony.webwork.validators.JavaScriptRequiredStringValidator"/>
> Oddly enough, XMLBuddy (in Eclipse) says that "name" must be declared.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message