Hi again

I'm sorry,I tried to send an answer yesterday with an example.war, but
it couldn't get through the mailing list. This is what i wrote:

I have attached a test.war where you can se an example. I remember that
I've had the IndexOutOfBounds but I cannot get it again.
I hope this little example will help you. In the future...take a look at
the nested tag, it really can help you. BUT the example also works.
Have a nice weekend.

So, the test.war was not a success, therefore I sent you an example with
nested-tag:

      <nested:iterate name="theForm" property="rows"
type="com.company.TheObjectType" >
        <tr>
          <td><nested:write property="firstName"/></td>
          <td><nested:write property="lastName"/></td>
        </tr>
      </nested:iterate>

Hope it will work for 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: Julio Cesar De Salvo [mailto:[EMAIL PROTECTED] 
Sendt: 27. februar 2004 17:04
Til: 'Struts Users Mailing List'
Emne: RE: ArrayList in Form


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]


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

Reply via email to