You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Andreas Andreou (JIRA)" <de...@tapestry.apache.org> on 2008/03/03 17:06:50 UTC

[jira] Commented: (TAPESTRY-2224) Improve javascript archetype for form handling and validation

    [ https://issues.apache.org/jira/browse/TAPESTRY-2224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574585#action_12574585 ] 

Andreas Andreou commented on TAPESTRY-2224:
-------------------------------------------

I see value in some of those suggestions... I guess the original thinking has been that you are
able to hook on or rewrite every js part that you want, so, not many configuration options were given.

I've never had to deal with 1,2,3 because i'd normally have a custom org.apache.tapestry.form.validatorValidator class
 to implement the behavior and it would also call my custom javascript for (any needed) client-side checks
Doing it this way, you dont have to deal with profiles, or where to attach your javascript, e.t.c.

For 4, tapestry.connect was meant for exactly that - connect to the tapestry namespace, because that's what
all the internal code was doing... however, supporting the 4 arguments version makes sense.

For 5, you just need to redefine tapestry.form.summarizeErrors the way you want.

> Improve javascript archetype for form handling and validation
> -------------------------------------------------------------
>
>                 Key: TAPESTRY-2224
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2224
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>         Environment: MacosX
>            Reporter: Numa Schmeder
>             Fix For: 4.1.6
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org