Struts 2
  1. Struts 2
  2. WW-600

Enable Client-side validation for visitor validations

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: WW 2.1
    • Fix Version/s: 2.3.15
    • Component/s: XML Validators
    • Labels:
      None
    • Environment:

      JDK 1.4.2, Tomcat 5.0.27, WebWork CVS (20040721)

      Description

      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.

        Activity

        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Lukasz Lenart made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Assignee Lukasz Lenart [ lukaszlenart ]
        Fix Version/s 2.3.15 [ 12324267 ]
        Fix Version/s 2.3.16 [ 12324546 ]
        Resolution Fixed [ 1 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.16 [ 12324546 ]
        Fix Version/s 2.3.15 [ 12324267 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.15 [ 12324267 ]
        Fix Version/s 2.3.14 [ 12324256 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.14 [ 12324256 ]
        Fix Version/s 2.3.13 [ 12324132 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.13 [ 12324132 ]
        Fix Version/s 2.3.12 [ 12324067 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.12 [ 12324067 ]
        Fix Version/s 2.3.11 [ 12323903 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.10 [ 12323903 ]
        Fix Version/s 2.3.9 [ 12323841 ]
        Lukasz Lenart made changes -
        Assignee matt baldree [ matt ]
        Lukasz Lenart made changes -
        Assignee matt baldree [ matt ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.9 [ 12323841 ]
        Fix Version/s 2.3.8 [ 12323480 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.8 [ 12323480 ]
        Fix Version/s 2.3.7 [ 12323448 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.7 [ 12323448 ]
        Fix Version/s 2.3.6 [ 12323249 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.6 [ 12323249 ]
        Fix Version/s 2.3.5 [ 12321274 ]
        Lukasz Lenart made changes -
        Fix Version/s 2.3.5 [ 12321274 ]
        Fix Version/s 2.5 [ 12319158 ]
        Lukasz Lenart made changes -
        Fix Version/s 3.x [ 12319158 ]
        Fix Version/s Future [ 12314681 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
        Lukasz Racon made changes -
        Attachment visitor_validator.patch [ 14051 ]
        Lukasz Racon made changes -
        Attachment visitor_validator.patch [ 14050 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 49035 ] Struts - editable closed status [ 52150 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 44147 ] Struts - editable closed status (temporary) [ 49035 ]
        Don Brown made changes -
        Fix Version/s Future [ 21530 ]
        Component/s Plugin - Tags [ 20003 ]
        Issue Type Bug [ 1 ] New Feature [ 2 ]
        Fix Version/s 2.1.x [ 21743 ]
        Component/s XML Validators [ 21370 ]
        Summary Client-side validation doesn't work as advertised Enable Client-side validation for visitor validations
        Jeff Turner made changes -
        Workflow Struts [ 40688 ] Struts - editable closed status [ 44147 ]
        Don Brown made changes -
        Workflow jira [ 33225 ] Struts [ 40688 ]
        Ted Husted made changes -
        Fix Version/s 2.0.x [ 21742 ]
        Fix Version/s 2.1.x [ 21743 ]
        Don Brown made changes -
        Fix Version/s WW 2.1.1 [ 21371 ]
        Assignee Patrick Lightbody [ plightbo@gmail.com ]
        Don Brown made changes -
        Fix Version/s 2.0.x [ 21742 ]
        Don Brown made changes -
        Fix Version/s Future [ 21530 ]
        Ted Husted made changes -
        Fix Version/s 2.0.1 [ 21741 ]
        Fix Version/s Future [ 21530 ]
        Don Brown made changes -
        Fix Version/s 2.0.0 [ 21510 ]
        Fix Version/s WW 2.1.8 [ 21571 ]
        Fix Version/s 2.0.1 [ 21741 ]
        Patrick Lightbody made changes -
        Fix Version/s 2.2.2 [ 21600 ]
        Fix Version/s 2.3 [ 21510 ]
        Rainer Hermanns made changes -
        Fix Version/s 2.1.8 [ 21571 ]
        Patrick Lightbody made changes -
        Fix Version/s 2.2.2 [ 21600 ]
        Patrick Lightbody made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Cannot Reproduce [ 5 ]
        Assignee Mark Woon [ unkyaku ] Patrick Lightbody [ plightbo@gmail.com ]
        Patrick Lightbody made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]
        Patrick Lightbody made changes -
        Assignee Mark Woon [ unkyaku ]
        Patrick Lightbody made changes -
        Field Original Value New Value
        Fix Version/s 2.1.1 [ 21371 ]
        Matt Raible created issue -

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Matt Raible
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development