-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philippe,

Pille wrote:
>>> how can i set a property of a dyna form from within an action?
>>
>> That's easy: just do the same thing you do in your SaveAction to get a
>> reference to the form bean. Then, instead of just calling accessors to
>> get the data our, call mutators to put data in. But, if you are talking
>> about accepting data from the form for re-display, why not just make it
>> part of the form and have Struts do that work for you?
> 
> can you get more in detail please? ;)

I'm suggesting that, instead of writing code in your action to call
request.getParameter("myFormStuff") and then poking it into the
DynaValidatorBean, you add the appropriate fields to your dynamic bean
(in struts-config.xml) so that Struts will populate (and validate!) your
form bean for you.

>> Whenever I need parameters to be forwarded across multiple actions, I
>> either put them in the form bean or do it manually by using hidden form
>> elements, pulling their values out in my submission handling actions,
>> and then put them back into the URLs of my redirect actions.
> 
> i had the ArrayList as property of a DynaActionForm. when i submitted
> the form the Bean wasn´t set anymore.

How were you trying to submit the data that was supposed to go into that
arraylist? Typically, one uses a special syntax for submitting indexed
information by using form field names such as "salary[1]" -- not the use
of the square-brackets and an explicit numeric index.

> but there is another thing i´ve been thinking of. earlier i had my own
> DynaActionForm class and i have set some properties in the
> struts-config.xml. the ArrayList (which holds the beans) was set as a
> property in my own class because i didn´t know how to access the getters
> and setters of a DynaActionForm. the form tag in struts-config.xml was a
> type of my own DynaActionForm extension. Is it ok to mix it like this or
> do i either have to implement every property in a own DynaActionForm
> class or do i have to declare everything in struts-config?

I would recommend that, if you are going to use DynaValidatorForm, you
just use it as-is instead of subclassing it.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFht4J9CaO5/Lv0PARAjKvAJ9ujuHgqP56RNsU+uwSwyl0umbmSgCgj2uq
UilHV6I9Sdlo6/e4uuDJQYQ=
=Hmsw
-----END PGP SIGNATURE-----

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

Reply via email to