You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Susan Bradeen <Su...@softlanding.com> on 2003/10/06 22:22:37 UTC
Re: Preparing Multiple DynaValidatorForm's with one action
On 10/06/2003 12:09:06 PM "Pat Quinn" wrote:
> I currently have an action (Action A) which is associated with
Action_Form_A
> ( i.e. org.apache.struts.validator.DynaValidatorForm) i want to forward
to
> another tile definition which requires Action_Form_B. I want to
initialise a
> List in Action_Form_B how can i do this as the action i'm currently in
only
> knows about ACTION_FORM_A. I only want to intialise actionforms within a
> common action i'll have seperate action to deal with submits.
>
> I've tried casting the inbound Action Form to type DynaValidator and
calling
> the relevant set methods but this fails as you'd expect as its
referencing
> ACTION_FORM_A only.
>
> Next i tried to create a new instance of DynaValidator & called
initialise:
>
> DynaValidatorForm dynaForm2 = new DynaValidatorForm();
> dynaForm2.initialize(pMapping);
> dynaForm2.set("name", "Joe Bloggs";
>
> This too fails with a nullpointer... i could forward to another action
which
> prepares the actionform for the next view... is there another way i
could do
> this?
>
Forwarding to another action which prepares the next view is probably the
most common (and perhaps the most recommended?) way to do it.
HTH,
Susan Bradeen
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org