Well, 

a) I have not used logic:iterate for these purpose, hence won't be able
to help you out much there. I use the JSTL tags and try to keep away
from the struts tag as much as possible.
b) I would use ArrayList instead of Vectors.


What I would do if I were you would be something like this: 

<table >
        <c:forEach var="someVarName" items="${yourForm.myVector}">
                <tr>
                        <td>
                                <c:out
value="${someVarName.profileName}"/>
                        </td>
                        <td>
                                <html:text indexed="true"
name="someVarName" property="userName"/>
                        </td>
                                <html:text indexed="true"
name="someVarName" property="password"/>
                        </td>
                        </tr>
        </c:foreach>
<table >

I have added the table just for clarity. 

You may want to put a check for empty or null collection doing either
<c:when test='${empty yourForm.myVector}'> In case you already have this
bean 
Or having another method like getSize() or something like that. 

Assuming that you have set and set methods on each one of the above
three parameters in your MultipleIdData bean. 

Try this and see if the vales get populated in the Collection when you
get it in your Action from the form.

This may contain some errors but should get you started :)

-----Original Message-----
From: Anna Yates [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 19, 2004 11:21 PM
To: [EMAIL PROTECTED]
Subject: Logic:iterate and html:text problem

I have multiple text boxes that I display on my page. Basically, I must
show n rows (2 text boxes per row). I have no problem displaying them,
but I am unclear on how to get the data back in a concise manner. To
display, I use logic:iterate (see below):


logic:iterate name="custAcctForm" id="multiple" property="multipleIds"

bean:write property="profileName" name="multipleIds"

html:text property="userName" name="multipleIds"

html:text property="password" name="multipleIds"



In my form I have a Vector defined, private Vector multipleIds; The
Vector holds a collection of my class, MultipleIdData which has 3 member
variables: 
profileName, userName, and password. When I use the code above, it
displays correctly, but the entered data goes nowhere. I have tried to
define the "id" property to the "multipleIds" value, but it gives me an
error that no collection was found. I was thinking I could index the
values, but am unclear if this is the road I should take.  I have seen
that if I initialize the Vector to some initial capacity, this will
work, but I don't know how large this Vector will be. Does anyone have
any suggestions. Thanks.

_________________________________________________________________
Check out the coupons and bargains on MSN Offers! 
http://shopping.msn.com/softcontent/softcontent.aspx?scmId=1418


---------------------------------------------------------------------
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