I' m in a similar situation but when I use the type element to cast the
object in the ArrayList throws an ClassCastException.

Any ideas?

Thanks, Julio



-----Mensaje original-----
De: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] 
Enviado el: Viernes, 27 de Febrero de 2004 08:48 a.m.
Para: Struts Users Mailing List
Asunto: SV: ArrayList in Form

Hi Shashank 

If I understand you correct, you want to modify the properties in an
object within a Collection

Do like this:

<logic:iterate id="rows" name="theForm" property="rows"
type="com.company.TheObject" >
        <html:text name="rows" property="firstName" indexed="true" />   
        <html:text name="rows" property="lastName" indexed="true" />
</logic:iterate>

There are 2 important things to remember:
 1. id attribute in the iterate tag MUST have the same name as the
property attribute in the iterate tag (rows)
 2. you have to set the attribute indexed to true ( indexed="true" ) 

Hope this wil help you

Med venlig hilsen

Claus Weng Madsen, Teamleder
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 30242875
www.telmore.dk 


-----Oprindelig meddelelse-----
Fra: Dixit, Shashank (Cognizant) [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 10:17
Til: [EMAIL PROTECTED]
Emne: ArrayList in Form


Hello All

I have a ArrayList in the form which contains a CustomObject "TheROw". I
iterate thr this arraylist to display it by <logic:iterate> as follows.
This row will contain many fields such as rate or amount.

<logic:iterate id="currentRow" name="theForm" property="rows"
type="com.custobj.TheRow" > \\ Display all rows </logic:iterate>


PROBLEM : When the form gets submitted with rate or amount changed I
expect I will get ArrayList back by changed values. But No change
happens in the values.

Does that mean that If one uses ArrayList in the form, it can be used
for the purpose of display only. If User changes some value we will not
get those changed values. 

Pls suggest solution or tell me if I am making some mistake over here.



Shashank S. Dixit 
Cognizant Technology Solutions Pvt. Ltd. 
Hinjewadi,
Pune
Mobile : 98904 25400 

An Obstacle is something you see when you take your eyes off the goal.



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


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

Reply via email to