dcsimg
Form validation errors in different frame? Possible?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rob_Breeds
Posted On:   Friday, October 19, 2001 05:34 AM

I'm writing my first Struts application and want to use one frame containing the input form and another frame to display the results. If I use validation in the ActionForm (or populate ActionErrors in the Action object), I know I can use to display errors in the input form (same frame). But do I HAVE to display the errors in the same frame as the input form? Could I do a in the results frame and get them to display there? I can't use TARGET="resultsframe" because if an error occurs, the input form will be displayed in the results frame. I'd need to refresh the results frame from the input frame. But if the errors collection is only    More>>

I'm writing my first Struts application and want to use one frame
containing the input form and another frame to display the results.


If I use validation in the ActionForm (or populate ActionErrors in the
Action object), I know I can use to display errors in the
input form (same frame).


But do I HAVE to display the errors in the same frame as the input form?
Could I do a in the results frame and get them to display
there?


I can't use TARGET="resultsframe" because if an error occurs, the input
form will be displayed in the results frame. I'd need to refresh the
results frame from the input frame. But if the errors collection is only
stored in the request, it'd be too late to retrieve the errors I think.


Is there a solution? Can I get to the errors collection from a different frame to the one containing the input form?


Thanks

   <<Less

Re: Form validation errors in different frame? Possible?

Posted By:   Ted_Husted  
Posted On:   Monday, October 22, 2001 10:41 AM

AFAIK, there is not a good solution for this. It's possible
that you might be able to save the errors to the session
instead, and then get the other frame to refresh somehow
to display them. But you would have to clear the errors
yourself before the next request, and there could be other
problems.


The error messages can also be displayed next to their
field concerned, which might be another design you could
consider.


If you do come up with a solution, please let me know.
This often comes up, but I've never seen a good answer


Ted

About | Sitemap | Contact