Hi,
I am new to Struts, JSP, JAVA and the works and am totally stuck here. I am
using arrays in my form.
What I am trying to do here is, display a list of documents to the user who
would then check the radio button and hit the SUBMIT button for only ONE of
the documents. I need to insert a record in the database for only the
submitted row. I manage to get my form array filled all correctly but how do
I know which record was submitted ? The way things are setup out here I
cannot use the "indexed" attribute in html:submit.
Here is my code.
Thanks a bunch,
Nandini
<logic:iterate id="mailingDocs" name="mrstockAdmin" property="allMailings"
indexId="index" type="com.mrstock.ejb.entity.codeRef.CodeRefData"
scope="session" >
<bean:define id="mDocs" name="mailingDocs" toScope="page"
type="com.mrstock.ejb.entity.codeRef.CodeRefData" />
<%
com.mrstock.ejb.entity.mailings.MailingsData mData =
new com.mrstock.ejb.entity.mailings.MailingsData();
mData.setAcctIdPrim(currentAccount.getAccountID());
mData.setCustIdPrim(currentCustomer.getCustomerID());
mData.setDocumentCode(mDocs.getColval());
mailingsform.setFormInfo(numDocs, mData, currentAccount );
String custIdStr = "custId["+numDocs+"]";
String acctIdStr = "acctId["+numDocs+"]";
String howDeliveredStr = "howDelivered["+numDocs+"]";
String howDeliveredDescrStr = "howDeliveredDescr["+numDocs+"]";
String documentCodeStr = "documentCode["+numDocs+"]";
%>
<html:hidden property="<%=custIdStr %>" />
<html:hidden property="<%=acctIdStr %>" />
<html:hidden property="<%=documentCodeStr %>" />
<tr>
<td>
<bean:write name="mailingsform"
property="<%=documentCodeStr %>"/>
</td>
<td>
<html:radio property="<%=howDeliveredStr %>" value="1">
Mail </html:radio>
<html:radio property="<%=howDeliveredStr %>" value="2">
Email </html:radio>
<html:radio property="<%=howDeliveredStr %>" value="3">
Fax </html:radio>
</td>
<td>
<html:submit value="SELECT" />
</td>
</tr>
</logic:iterate>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>