Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2224

Improve javascript archetype for form handling and validation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • 4.1.7
    • Core Components
    • None
    • MacosX

    Description

      Hello,

      After looking carefully at form.js and core.js. There are problems with the skeleton concerning form validation :

      • There is no way to override or intercept a form submit event if the form is submitted asynchronously, same for refresh or cancel ....
        this is very much needed if you want a function to be notified when one of this event happens
        WETHER by tapestry.form.onsubmit("myForm", myFunction) OR tapestry.connect("myForm", "onsubmit", myFunction)
      • There is no standard way to append a validation message to the stack of validation messages created from the form profile.
        One should be able to call tapestry.invalid_field('The field blah is invalid', isMissing ) And this should be appended to normal validation
      • Validation profiles are rather not clear, complicated and considered as instable in the dojo tree, all the validation should not depend only on this mechanism...
      • tapestry.connect assumes you connect a function in the tapestry namespace !? that's wrong, it should be :
        For 3 args : search for the function in the tapestry namespace and global namespace
        For 4 args : search for the function in the given namespace
      • validation using tapestry should not impose its method to show JS validation messages... Actually it is a a dialog widget from dojo. But it should be made simple to override that with your own presentation function :
        ex: tapestry.form.summarizeErrors(form, messages)

      Numa

      Attachments

        Activity

          People

            andyhot Andreas Andreou
            numito Numa Schmeder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: