When we discovered this problem, we said "screw automatic validation",
turned it off for all action mappings, and resorted to calling the validate
method(s) in our ActionForm from the action itself, passing in an
ActionErrors object to be populated by these validate methods.  If the
ActionErrors object isn't empty after this call (meaning there were errors),
we reinit the form's fields (for drop-downs, etc.), save the ActionErrors
object, and forward back to the page in question.

Not a perfect solution, but it keeps excess logic and DAO calls out of your
ActionForm's reset method.

peace,
Joe

> -----Original Message-----
> From: Graham Lounder [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 12:59 PM
> To: Struts Users Mailing List
> Subject: RE: Using Reset to Load Drop Downs?
>
>
> Yeah, that is what I started to do, loading my drop downs in the
> get method
> if the list is null.  In the reset method I set my drop down
> lists to null.
> I thought about putting them in the session and came to the same
> conclusion
> as you, no way to determin when to get rid of them.
>
> Does anyone have a better solution to this problem?  I feel all dirty
> putting logic in my forms.
>
> Graham
>
> -----Original Message-----
> From: Adam Hardy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 4:15 PM
> To: Struts Users Mailing List
> Subject: Re: Using Reset to Load Drop Downs?
>
>
> I do that. The problems include getting error messages out when
> something goes wrong, and potentially fetching huge lists if the
> parameters are wrong. Can't think of any others.
>
> I used to get the dropdown lists in the action, and store them in the
> session, but I couldn't think of a way of getting rid of them from the
> session easily.
>
> Adam
>
>
>
> Graham Lounder wrote:
> > Hell All,
> >
> > I'm having a small problem with loading my drop downs after a validation
> > error (since my action is not being called again).  It is
> recomended/good
> > practice to load my drop downs in the reset method of the form?  Is it
> > possible?  I would load them once my application starts, but I need to
> > modify the list before it is displayed.
> >
> > Any Ideas?
> > Graham
> >
> > ============================================
> >   Graham Lounder
> >   Java Developer
> >   Spatial Components Division
> >   CARIS
> >   264 Rookwood Ave
> >   Fredericton NB E3B-2M2
> >   Office 506 462-4218
> >   Fax    506 459-3849
> >   [EMAIL PROTECTED]
> >   http://www.spatialcomponents.com
> > ============================================
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to