You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Gerdau <mi...@cth.de> on 2000/11/30 17:42:02 UTC
Q: How to dynamically initialize form:select ?
Hi !
I'm slowly becoming familiar with struts.
I'm now faced with the following problem:
I have a form in the middle of my application which among other
things sports a dynamically populated form:select.
Re: How to dynamically initialize form:select ?
Posted by Pierre Métras <ge...@sympatico.ca>.
Hi Michael,
> Or in other words: does struts allow for some convenient means
> to initialize a page upon creation ? Some kind of PreAction ?
I add a similar problem and requested for such a feature.
Now, in Struts 1.0, you can use the ActionForm.reset(mapping, request) to
fill your form with some values, before auto-population by Struts. Based on
the request parameters or the mapping, you can detect if it's a first time
initialization and do what you want. What can be disturbing is that Struts
always comes after you and replaces your values with the request parameters
values, but you shouldn't be concerned when you want initialization.
If you're using version 0.5, bad luck! I did the move to 1.0 for that
reason...
Pierre Métras