You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2006/01/04 21:33:50 UTC

DynaActionform initialize

In struts-config

<form-bean name="Form1" type="org.apache.struts.action.DynaActionForm" 
dynamic="true">
         <form-property name="property1" type="java.lang.Integer"/>
         <form-property name="property2" type="java.lang.Integer"/>
         <form-property name="property3" type="java.lang.String"/>
    </form-bean>

    <form-bean name="Form2" type="org.apache.struts.action.DynaActionForm" 
dynamic="true">
         <form-property name="method" type="java.lang.String"/>
    </form-bean>

In the Action of PrepareForm2

Would like to create an ArrayList of Form1.



Is it possibel to do this? if so how to do this?

i.e can we instanciate a DynaActionfom?

thanks.

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DynaActionform initialize

Posted by Rick Reumann <st...@reumann.net>.
fea jabi wrote the following on 1/4/2006 3:52 PM:
> yes, that's right.
> 
> have a table in my jsp which used form2.
> 
> form1 properties are a row in a table.
> Would like to create a list of DynaActionform objects which would be the 
> rows of my table.

Ok, that's what I thought. You only need one Form (not a collection of 
Form beans) and just use a Collection as a property in your DynActionForm...

<form-property name="productOrders" type="java.util.Collection"/>

Now make sure you put your Collection of productOrders (or whatever 
objects you need in your List) and you could use that in your form.

ArrayList list = somwhere.getMyListOfRows(); //each row should represent
                                              //an object
yourDynaForm.set("productOrders", list );



-- 
Rick Reumann
http://www.tech.reumann.net - Struts lessons, articles, etc.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DynaActionform initialize

Posted by fea jabi <zy...@hotmail.com>.
yes, that's right.

have a table in my jsp which used form2.

form1 properties are a row in a table.
Would like to create a list of DynaActionform objects which would be the 
rows of my table.


I hope I am clear this time.


>From: Rick Reumann <st...@reumann.net>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: Struts Users Mailing List <us...@struts.apache.org>
>Subject: Re: DynaActionform initialize
>Date: Wed, 04 Jan 2006 15:44:05 -0500
>
>fea jabi wrote the following on 1/4/2006 3:33 PM:
>
>>In the Action of PrepareForm2
>>
>>Would like to create an ArrayList of Form1.
>
>When you say an ArrayList "OF" Form1 do you really mean a List of 
>ActionForm objects (in your case a List of DynaActionForm objects)?
>
>Typically you will never need to do this. I haven't run across a need yet. 
>There is probably a better way to accomplish what you want. Give us more 
>details on what you need to capture.
>
>
>--
>Rick Reumann
>http://www.tech.reumann.net
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DynaActionform initialize

Posted by Rick Reumann <st...@reumann.net>.
fea jabi wrote the following on 1/4/2006 3:33 PM:

> In the Action of PrepareForm2
> 
> Would like to create an ArrayList of Form1.

When you say an ArrayList "OF" Form1 do you really mean a List of 
ActionForm objects (in your case a List of DynaActionForm objects)?

Typically you will never need to do this. I haven't run across a need 
yet. There is probably a better way to accomplish what you want. Give us 
more details on what you need to capture.


-- 
Rick Reumann
http://www.tech.reumann.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org