Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: Re: Accessing a row in a table on a JSP page.

Subject: Re: Accessing a row in a table on a JSP page.

2007-10-03       - By Nikhil Walvekar

 Back
Hi,

You can try using javascript, on button submit call a function which will
set row-index to a hidden field and which will be submitted with form. On
server side you can use this field to identify the row.

Regards,
Nikhil

On 10/2/07, JohnLangan <langanj@(protected)> wrote:
>
>
> I call the database and create an ArrayList of beans to hold the data.
> Using
> JSTL I iterate over the list
> to display the data in an html table inside a form in a JSP page.
>
> <c:set var="dataItems" value="${lmdao.listingManagerData}" />
> <c:forEach var="item" items="${dataItems}" varStatus="row" >
> I can give each row a number using ${row.index}
>
> The last but one column is a Struts html:select that allows the user to
> select what they want to do next. The last column contains a button to
> press
> to implement the selected action. So far so good.
>
> My problem is that in whichever row the button is pressed it always acts
> on
> the data in the first row.
> I have tried several ways including indexed properties or using an
> ActionForm with an array of beans so each row is a copy of the bean, but I
> cannot get the action to act on the required row.
>
> Is there a way in Struts for the action to know in which row the button
> was
> pressed? Apart from the html:select dropdown all the other values required
> for the action are hidden values.
>
> Thanks in advance for any help with this.
>
> John.
> --
> View this message in context:
> http://www.nabble.com/Accessing-a-row-in-a-table-on-a-JSP-page.-tf4555354
.html#a13000517
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Nikhil

©2008 junlu.com - Jax Systems, LLC, U.S.A.