If you just want to use html:link, you don't necessarily have to use an
ActionForm class (though you can, if you want).
Here's some code for generating a list with links. Result is a bean that
exposes a collection named rows.
<logic:iterate name="result" property="rows" id="row">
<p>
<html:link forward="donor" paramName="row" paramId="key"
paramProperty="donor">
<bean:write name="row" property="donor" filter="true"/>
</html:link>
</p>
</logic:iterate>
When the page renders, it generates links like this:
<a
href="http://localhost/struts-stub/donor/View.do?key=123456">123456</a>
where there is a global forward "donor" with the path "/donor/View.do"
and row.getDonor() returns 123456
DHarty wrote:
>
> This is really a two part question.
>
> I have an iterative loop that displays a list users that are stored in
> Action Forms. The idea is that when the button (or link) next to the item
> is selected, the user will be allowed to make modifications to the selected
> form:
>
> <logic:iterate id="user" name="SearchForm" property="result">
> <tr>
> <html:form action="/usermodify">
> <td align="center">
> <bean:write name="user" property="username"/>
> </td>
> <td align="center">
> <html:submit property="username">Modify
> </html:submit>
> </td>
> </html:form>
> </tr>
> </logic:iterate>
>
> Where "result" is a vector of ActionForms.
>
> Currently, when the "Modify" button is selected, the appropriate action
> class is called, but the ActionForm is reset.
>
> I know I could add a field to the submit button, i.e:
>
> <html:submit property="username">Modify <bean:write
> property="username"/></html:submit>
>
> and then have the action class look up the user in hte database again, but I
> would rather not.
>
> I was considering using an html link instead of a button, but was unsure how
> to proceed.
> Ideally, I would like to use an html link, while retaining the existing form
> (without having to look it up again).
>
> Any thoughts or comments would be appreciated.
>
> Thnxs
>
> David