You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Andrew H. Peterson" <ap...@e-gineering.com> on 2002/03/10 11:39:27 UTC

Using Struts to capture form grid info

I have a form that has an HTML table of text inputs.  Each row of inputs has
a unique identifier that I can map to it.  I can also map the column names
to a column name in the db.

I was thinking that I could construct the name of each input in such a way
as to extract the id and column name from each when posting the form to the
server.

For example,

<html:form action="myAction.action">
<table>
<tr>
<td><html:text property="week1_monday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week1_tuesday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week1_wednesday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week1_thursday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week1_friday_myDailyValue" size="20"
maxlength="20"/></td>
</tr>
<tr>
<td><html:text property="week2_monday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week2_tuesday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week2_wednesday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week2_thursday_myDailyValue" size="20"
maxlength="20"/></td>
<td><html:text property="week2_friday_myDailyValue" size="20"
maxlength="20"/></td>
</tr>
</table>
</html:form>

My question is... Is there a Struts way of doing this?  How would I
construct the Form object to create a collection of information?

Any help is appreciated.  Thanks.

Andrew



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>