File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting data from a dynamic table in one JSP to another JSP

 
Harish Maridi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a table which is dynamically generated in a jsp(first.jsp). I provided a hyperlink to a column in that table.When I click that hyperlink, the page is redirecting to second.jsp

I want to transfer the whole row that selected in that table to be displayed on another JSP.Can anybody please suggest me a way to do it.

I am using struts framework in my application.

Thankyou....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64175
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could consider using hidden input elements to capture the data that you want submitted.

Since you are using Struts, I've shifted this over to the Struts forum.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to do it would be to keep the table in session scope as a java.util.List. You could then simply pass the index of the element selected, and the second JSP could retrieve the values from the List for that index. If you want to do it without using session scope, Bear's suggestion of using hidden fields is your best option.
[ June 03, 2008: Message edited by: Merrill Higginson ]
 
Harish Maridi
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said it is dynamically generated table.
I assaigned a hyperlink to the column, and I assigned "id" to it.. code is as follows.



I have java script :

function O()
{
var x = document.getElementById("tikno");
alert(x.innerHTML);

}

it is returing the value of the clicked column but it is giving same value for every column.

How can I get a different values for different columns.

Thankyou...
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using a <logic:iterate> tag to generate the table, you can use the indexId attribute to generate an index variable that can then be used to uniquely identify each row. Example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic