Tapestry
  1. Tapestry
  2. TAPESTRY-1748

Field validators continue to generate client-side JavaScript even though the Form is configured to not do client-side validation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5, 5.0.6
    • Fix Version/s: 5.0.7
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The T5 validators generate the validation JavaScript although the form has set "clientValidation=false". The form does not inlude the required JS-libs when "clientValidation=false. This leads to an JS error on the client side.

      This script is generated with clientValidation=false:
      <script language="javascript" type="text/javascript">
      <!--
      Event.observe(window, "load", function() {
      Tapestry.Field.required('nameField', 'You must provide a value for
      Name.');
      });
      // -->
      </script>

      This is the error in Firefox:
      Error: Event.observe is not a function
      Source: http://localhost:8080/tapestry-form-noclient/
      Line: 18

        Issue Links

          Activity

          Hide
          Christian Köberl added a comment -

          Here is a simple example, that shows the error. Just run "mvn jetty:run" and point jour browser to http://localhost:8080/tapestry-form-noclient/start

          Show
          Christian Köberl added a comment - Here is a simple example, that shows the error. Just run "mvn jetty:run" and point jour browser to http://localhost:8080/tapestry-form-noclient/start
          Hide
          Christian Köberl added a comment -

          Both bugs seem to be fixable in one go

          Show
          Christian Köberl added a comment - Both bugs seem to be fixable in one go
          Hide
          Howard M. Lewis Ship added a comment -

          The fix is part of the new relationship between the Form (via FormSupport) and the validators, wherein a JSON description of form validation is sent down, rather than the raw JavaScript to setup the form validation.

          Show
          Howard M. Lewis Ship added a comment - The fix is part of the new relationship between the Form (via FormSupport) and the validators, wherein a JSON description of form validation is sent down, rather than the raw JavaScript to setup the form validation.

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Christian Köberl
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development