This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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

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);

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

Joined: Nov 08, 2001
Posts: 15385
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?

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

Joined: Jan 10, 2002
Posts: 63232

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:
subject: dynamic Row generation? no source code?
jQuery in Action, 3rd edition