I think this will help:
http://jakarta.apache.org/struts/faqs/indexedprops.html

David



From: "Vinay" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: <c:for each> <html:form> textboxes
Date: Mon, 3 Feb 2003 11:55:34 -0500

Hi All,
I have the following code

<html:form action="update.do>
<table border="1">

<c:forEach var="transid" items="${trans.transactions}">
<tr>
<td><c:out value="${transid.acctno}"/></td>
<td><c:out value="${transid.testcode}"/></td>
<td><c:out value="${transid.srcfac}"/></td>
<td><c:out value="${transid.dateofservice}"/></td>
</tr>
</c:forEach>
</table>
</html>


Instead of printing the values I want them to be textboxes for editing

like this, which can be used later for updating database with the edited values


<html:form action="update.do>
<table border="1">

<c:forEach var="transid" items="${trans.transactions}">
<tr>
<td> <html:text property="transAcct" value="${transid.acctno}"/> </td>
<td> <html:text property="testcode" value="${transid.testcode}"/></td>
<td> <html:text property="srcfac" value="${transid.srcfac}"/></td>
<td> <html:text property="dos" value="${transid.dateofservice}"/></td>
</tr>
</c:forEach>

</table>
</html>

I am not sure how that property should be used so that it can be used.I think that it has to be indexed with transid , I am not sure whether it should be an array or Collection of objects. I am new to struts and using DynaValidatorForm.

I am trying to understand what should be in struts-config.xml

<form-bean
name="holdTransForm"
type="org.apache.struts.validator.DynaValidatorActionForm">
<form-property name="transAcct" type="java.lang.String"/>
:
:

</form-bean>

Thank you,

Help appreciated,

Vinay





_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail


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

Reply via email to