> -----Original Message-----
> From: andy wix [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 30, 2004 1:04 PM
> To: [EMAIL PROTECTED]
> Subject: Identifying the 'clicked' line when iterating over collection
> 
> 
> Hi,
> In my jsp page I have an ArrayList of contact objects and I 
> use this to 
> build an html table; one contact per row. At the end of each 
> table row I 
> have edit and delete links such that the form looks roughly like:
> 
> Name          Number
> Fred            1234            edit      delete
> Barney         2345            edit      delete
> 
> What's the best way to identify which link was clicked?
> I know I can make each link name unique by using the index 
> used to iterate 
> through the collection and assign this to the link ID.  Then 
> (if I knew how) 
> I could get JavaScript to identify which link was selected 
> and add this to 
> the request/session.   Does Struts have a 'posher' way of 
> doing this and, if 
> not, does anyone have the JavaScript required?

I use:
<html:link forward="editContact" paramId="id" paramName="beanname" paramProperty="id"/>
a lot, then agian I have an id for every record rather then use PK's.
You could do the same thing with an index, if you put the array into session scope.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to