You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Drew Davidson <dr...@ognl.org> on 2004/09/11 01:06:34 UTC
Passing ValidationDelegate state around and restoring it
I've got a validation question for those of you in the know about these things...
Despite some really slick error reporting that I did with ValidField and the like, my client insists
on a page flow that, when validation errors occur, takes you to a different page that enumerates the
errors, then back to the original page with errors highlighted (when a link is clicked).
The problem is that I'm using the validation delegate (beans.delegate) and although I've managed to
make it do the right thing and forward the delegate to the ValidationErrors page of mine (which
displays the errors perfectly, thank you very much!) I can't get back to the calling page
with the delegate restored properly. I want to preserve the entered values (that were in error) and
the error messages, etc. and display the page with error markup.
The problem is that the ValidationDelegate has no way of serializing and deserializing it's state;
it's also hooked into the components on the page so serialization wouldn't work. I just need to
save/restore the references to form element names and entered values.
Any suggestions? Ever heard of this kind of error handling before? I hope that the answer is not
to store the delegate into the Visit and extract it somehow. I'd rather "bucket brigade" the state.
- Drew
--
+---------------------------------+
< Drew Davidson | OGNL Technology >
+---------------------------------+
| Email: drew@ognl.org /
| Web: http://www.ognl.org /
| Vox: (520) 531-1966 <
| Fax: (520) 531-1965 \
| Mobile: (520) 405-2967 \
+---------------------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Passing ValidationDelegate state around and restoring it
Posted by Terry Poot <tp...@goldenvoid.com>.
Is there any way to go back to the page with the same set of values and
have tapestry revalidate the form as it did before? If so, you could
have a "been there, done that" flag in your Visit to tell you whether
you'd already displayed the error page.
Nope, I've never seen a site work that way. :)
Drew Davidson wrote:
> I've got a validation question for those of you in the know about
> these things...
>
> Despite some really slick error reporting that I did with ValidField
> and the like, my client insists on a page flow that, when validation
> errors occur, takes you to a different page that enumerates the
> errors, then back to the original page with errors highlighted (when a
> link is clicked).
>
> The problem is that I'm using the validation delegate (beans.delegate)
> and although I've managed to make it do the right thing and forward
> the delegate to the ValidationErrors page of mine (which displays the
> errors perfectly, thank you very much!) I can't get back to the
> calling page
> with the delegate restored properly. I want to preserve the entered
> values (that were in error) and the error messages, etc. and display
> the page with error markup.
>
> The problem is that the ValidationDelegate has no way of serializing
> and deserializing it's state; it's also hooked into the components on
> the page so serialization wouldn't work. I just need to save/restore
> the references to form element names and entered values.
>
> Any suggestions? Ever heard of this kind of error handling before? I
> hope that the answer is not to store the delegate into the Visit and
> extract it somehow. I'd rather "bucket brigade" the state.
>
> - Drew
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org