Balkan Guler wrote:
There are some tables in database and I have to transfer them to the web
pages.
Also they can be deleted and edited.
I am using Struts.
I populate a list of objects from tables.
And put this list in a formbean
and list them in a web page as below:
<logic:iterate id="omenu" name="operForm" property="operMenus">
<tr>
<td> <bean:write name="omenu" property ="description"/></td>
<td> <bean:write name="omenu" property ="action"/></td>
</tr>
</logic:iterate>
I want to make all rows editable therefore I am thinking of puting a
button(edit) at the end of all rows and if clicked show all details in text
boxes in a new popup.
the question is how can I recognize the clicked row and populate them in a
new window?
You'll need to include a row ID (preferably the primary key column from the
database, but anything that uniquely identifies the row is fine) as a
property in your form bean to use in the URL the 'edit' link submits. If
your table is already wrapped in a form, you can just add a button (or an
input of type 'submit') on each row, using the row ID as the request
parameter value for the button. If not, you can either add a wrapping form,
add a separate form on each row. Alternatively, use a link instead of a
button, which will work whether you have forms on the page or not.
L.
--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]