I finally had a chance to take a look at this. It's neat, but one more thing would make it a killer RIFE feature in my opinion: it should be able to call custom validation code in the originating element. A simple use case: a sign-up form that gives you real-time feedback that the username you want is already taken and, using the error text, suggests an alternative. For static validation I think I'd almost rather do it with straight JavaScript than with AJAX since it scales better (and any user that can do AJAX validation obviously has JavaScript enabled.)

I know you can add validation code to the bean itself, but that's not sufficient; some of the validation might depend on the context in which the form is being submitted. For example, only an admin user might be allowed to enter certain values in a particular field. A bean's validate() method can't know whether it's being edited by an admin user.

Also, once you can call back to the element that added an AJAX-enabled form field, this can evolve into a bidirectional communication channel between an element and a client, not just something for form validation. That's one thing that I think is lacking with the DWR approach: you can only communicate with a standalone Java object that exists in a vacuum and is reinstantiated from scratch on each interaction, rather than with a RIFE component that has all the context about what the user is up to and (in the case of an embedded component) about which of several possible instances of a given UI component the user is manipulating.

And once you have a mechanism for communicating with an element, my gut tells me that mixing AJAX and continuations will lead to some very compelling design patterns. But I admit I can't picture them clearly enough off the top of my head to write them up here.

Good work so far! (And yes, I realize what I'm suggesting is not trivial.)

-Steve


Tyler Pitchford wrote:
I wrote up an AJAX Form Validation Framework for RIFE. The framework
uses your existing MetaData and ERRORS: / MARK: tags to build it's
responses, so the AJAX validation will look exactly like the standard
POST validation that RIFE uses. Thought some of you might find it
useful, so I posted the source code and a small article on how to use
it:

http://rifers.org/wiki/display/RIFE/Adding+AJAX+Validation+To+Your+Forms

I'd appreciate any feedback or bugs you find.

Happy coding,
 Tyler
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to