I agree that it would be a useful idea. I actually thought of the username example when I was first making the framework. I realized it would be a pretty big mod, but one that's definitely worthwhile. I settled on allowing the unique() constraint to handle conflicting names. Obviously, this doesn't allow possible name suggestions from RIFE. A possible solution is to add "hooks" into the JS to evaluate the returns from RIFE. I need to brainstorm on a way to make this smooth and with as little "extra" code as possible.
Thanks for the comments, Tyler On 7/18/06, Steven Grimm <[EMAIL PROTECTED]> wrote:
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
_______________________________________________ Rife-users mailing list [email protected] http://lists.uwyn.com/mailman/listinfo/rife-users
