aspose file tools*
The moose likes Struts and the fly likes How to pass row id of colection to next JSP page for display using Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to pass row id of colection to next JSP page for display using Struts" Watch "How to pass row id of colection to next JSP page for display using Struts" New topic
Author

How to pass row id of colection to next JSP page for display using Struts

Mark Brothers
Greenhorn

Joined: Apr 15, 2004
Posts: 14
Here is where I want to place the program name on my second jsp page: (This now works fine to get the program name � but it returns the program names in the collection, so I can have multiple program names if there were more than one row of data on the previous page)

<TD align="right"><I>Program</I></TD>
<TD>
<logic:iterate indexId="indx" id="part" name="r.juvParticipationData">
<osca:emailProgram name="part" juvenile="r.juvData" user="s.userData"/>
</logic:iterate>
</TD>

How do I check each iteration in the above code to see if it equals the row index of the selected data row that was on the previous jsp page (shown below)? Here is the code that places the link on the jsp (IN BOLD) that a user might choose (each row would have a different index number for the collection of iterations). Where in this code would I put some code to write the row index to the session (or somewhere so it can be available to the next page to test against the collection again to get the program name associated with the same record row as on this page)?

<logic:iterate indexId="indx" id="part" name="r.juvParticipationData">
<TR bgcolor="<osca:evenodd name='indx' even='#ffffff' odd='#cccccc'/>">
<TD rowspan="2" valign="top"><bean:write name="part" property="agencyName"/> </TD>
<TD rowspan="2" valign="top"><osca:casenetLink name="part" juvenile="r.juvData" user="s.userData"/> </TD>
<TD><bean:write name="part" property="contactFName"/> <bean:write name="part" property="contactLName"/> </TD>
<TD> </TD>
<TD><bean:write name="part" property="agencyLocation"/> </TD>
</TR>
<TR bgcolor="<osca:evenodd name='indx' even='#ffffff' odd='#cccccc'/>">
<TD><bean:write name="part" property="contactPhone"/> </TD>
<TD><bean:write name="part" property="contactFax"/> </TD>
<TD> <a href="<osca:sendEmail juvenile="r.juvData" part="part"/>"><bean:write name="part" property="contactEmail"/></a></TD>
</TR>
</logic:iterate>


Thanks so much for your help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass row id of colection to next JSP page for display using Struts
 
Similar Threads
Capturing the element in collection that was chosen
help with html radio tag
Nested:iterate
Dynamic radio buttons matrix using Struts
getting errors