Thanks. I moved my call to populate the dropdown values from the Action
descendant perform() method to the ActionForm descendant reset() method.
That worked & makes sense to me.

Question: Is this violating any kind of "separation" rule that I'm going to
get drilled on by other developers?

Wayne
[EMAIL PROTECTED]


-----Original Message-----
From: Incze Lajos [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 1:43 PM
To: [EMAIL PROTECTED]
Subject: Re: dropdown values gone after validation error


On Thu, Mar 29, 2001 at 10:49:24AM -0600, Young, Wayne wrote:
> I have the following struts/JSP fragment that creates a dropdown with
values
> from the networkTypes attribute. 
> 
> <html:select styleClass="Field" property="networkType" size="1">
>   <html:options property="networkTypes"/>
> </html:select></td>
> 
> The networkTypes attribute is created in the "getNetworkTypes" action that
> displays this page. The page displays correctly initially. But if I have a
> validation error & the page reloads, the networkTypes variable is empty &
I
> end up with an empty dropdown.
> validation error? Is there any way to re-invoke the "getNetworkTypes"
action
> from the Validate() method on my ActionForm descendant? (Maybe forward to
> the "getNetworkTypes" action & return null in Validate?)
> 
> Any help would be appreciated.
> 
> Thanks.
> 
> Wayne
> [EMAIL PROTECTED]

That's what the reset method of the FormBean is for. The ActionServlet
calls that method before populating request parameters when the bean was
created. (So, if it was in request scope, on every submit - actually, you
have tosave the state of your options in some way and reset it in the
reset method. Or you use a session bean and the reset is called only
once to initialize the bean - but save it's state between submits.)
                                                                  incze

Reply via email to