Hi Nicolas,
  I think I get what you are trying to do here.  How about just a link to get you 
there rather than a button.  Here is the code from my jsp which iterates through a 
collection of users and sets up a link for each which goes to the same Action, but the 
key is passed as a request paramater which you can retrieve in the Action and populate 
your Form.

  <strutslogic:iterate name="UserCollection" property="listOfUsers" id="user" >
   <tr class="body">
    <td> &nbsp; &nbsp; &nbsp;
     <strutshtml:link href="edituser.do"
        paramId="APP_USER_ID"
        paramName="user"
        paramProperty="APP_USER_ID">
        <strutsbean:write name="user" property="APP_USER_ID" />:
     </strutshtml:link>  
        <strutsbean:write name="user" property="FIRST_NAME" />
        &nbsp;
        <strutsbean:write name="user" property="LAST_NAME" />
    </td>
   </tr>
  </strutslogic:iterate>

Brian


>>> [EMAIL PROTECTED] 10/23/01 09:33pm >>>
Hi,

I have a JSP page which display a list of elements from a Vector in a HTML table.
I want to put a button in each line of my table that let me view the element's detail 
(throught my elementForm)
I don't know how I can pass a specific element to my viewElementDetailAction which use 
an elementForm
I tried to use a standard form tag like this, but it doesn't works

Is this the correct approach?

Thanks for any suggestions,



Nicolas

<table>
<logic:iterate id="element" type="myPackage.elementClass" 
name="myVectorOfElementInstances">
<tr>
<td><bean:write name="element" property="elementKey" filter="true" /></td>
<td><bean:write name="element" property="firstName" filter="true" /></td>
<td><bean:write name="element" property="lastName" filter="true" /></td>
<td>
<form method="post" action="/viewElementDetailAction" name="elementForm" 
type="myPackage.elementForm">
<input type="hidden" name="no" value="<bean:write name="element" property="elementKey" 
filter="true" />">
<input type="submit" name="btnView" value="View"/>
</form>
</td>
</tr>
</logic:iterate>




Reply via email to