Actually, I'm thinking the Element could "trap" the errors it wants
and replace them itself before it's sent back over AJAX. Right now,
the Server compiles the template, extracts what the error message(s)
would have been on a post back and sends that to the client. It
wouldn't be hard for the Element to trap that response and simply
replace it with whatever it wants. The tricky part is hooking the
error calls correctly, because the way the frame is now, I never see
what went wrong, I only see the "final" output. Hmmm.

Cheers,
 Tyler

On 7/18/06, Steven Grimm <[EMAIL PROTECTED]> wrote:
Doesn't the server already send down an error message for the particular
validation failure based on what's in the template? Presumably as an
initial version of the functionality, a validation function could just
supply its own error string that would get displayed the same as any
other error.

Obviously it would be better to be able to return whatever you like and
have the client-side code execute its own logic based on the return
value. And actually I don't imagine that'd be too hard compared to the
rest of the change -- maybe just as simple as

if (! self.rifeAjaxValidationCallback ||
    ! rifeAjaxValidationCallback(formFieldThatCausedTheAjaxCall,
responseFromServer))
{
    display the error message as before
}

But that can be a version 1.1 thing if it's more complex than that --
just having arbitrary context-sensitive server-side validation will be
huge on its own.

-Steve


Tyler Pitchford wrote:
> 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

_______________________________________________
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