my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes dynamic Row generation? no source code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "dynamic Row generation? no source code?" Watch "dynamic Row generation? no source code?" New topic
Author

dynamic Row generation? no source code?

Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35
I need to generate dynamic rows in jsp with struts 1. i used this javascript to clone row

function addRow(tableID)
{
var tblBody = document.getElementById(tableID);
var newNode = tblBody.rows[1].cloneNode(true);
tblBody.appendChild(newNode);
}

now problem is there no source code of cloned rows . only first row source code is there I declared properties of the form as Arrays in ActionForm.

any body tell me how to get cloned rows source code? or any other way of generation dynamic rows?

Thanks in Advance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
It is impossible to view the page source and see the new rows. The view source is only what came from the server, it is not what is in your browser's memory.

Is your real problem when you post to the server, you are not getting the new form element's values?

Eric
Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35
OK , then i need to generate rows at client side , while data entry , it is as invoice you can generate rows as no. of items are purchased. how can i implement this kind of scenario while using struts 1. help me
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Struts executes on the server. It will be of no help with client-side activities.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic Row generation? no source code?
 
Similar Threads
javascript export html table to Excel
Alternative to ActiveXObject
adding and deleting a row in html
how to retrieve a particular value from datatable
retain row highlighting after selecting a row in datatable