my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes row selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "row selection" Watch "row selection" New topic
Author

row selection

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
how to select a row of a dynamically generated table? any pointers would be of great help....thank you!
manoj r patil
Ranch Hand

Joined: Jun 06, 2002
Posts: 181
Your this post is also not clear. What do you mean by "selecting a row"? What is your table structure?


love your job and not your company;
...because you never know when your company will stop loving you!
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have a table with 3 columns...The header is static but the rows are dynamically added using a Javascript .The values for row are set using a form with 3 text fields.This is how it goes...First on load I have a table with header.Below that I have an Add button.A click on Add button generates a form with 3 text fields.On click of submit button the form is hidden from UI and a row is added with values in their corresponding places and the process could continue.Now for mouse over,mouseout and mouseClick I have have a Javascript function that shows the difference by using colors(green during mouseover,and row click,non during mouse out) but I don't know where to call and use this function since my row is dynamic.I need to get the row from the 1st javascript and check...how to do this? is this clear? (on farther side --->By selecting the row I need to modify,delete the row and update in DB/XML,but before that I should be able to go through all the rows using the mousepointer and show the user which row I am selecting for operation...) sorry the code is a bit big,if still not clear I would post!!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Do you want to use Ajax or a normal form submission?

So you add an onclick event. You grab the row object and you look at the id, column data, etc. You can either put it in an Ajax call to the server or hidden fields and post the data back to the server to be updated.

Eric
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Hi Eric....

I am a tyro and I am developing in struts and can only understand the meaning of wthat you have said...an example of your aforementioned would make bring abundant clarity..thankyou!

-- pradeep
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
An example of what?

I am not going to code 2 applications for you. lol

Eric
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Hi Eric....

I am a tyro and I am developing in struts and can only understand the meaning of wthat you have said...an example of your aforementioned would make bring abundant clarity..thankyou!

-- pradeep
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
An example of what?

I am not going to code 2 applications for you. lol

Eric

[ ]
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I meant an example or a link as to how to transfer data as an ajax call to another jsp and use it there... thnx!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
ajax tutorial is a good starting point

Eric
 
Don't get me started about those stupid light bulbs.
 
subject: row selection
 
Similar Threads
Flashing a row in Jtable
Isolation levels in a transaction
Looping over the contents of the file...
Stored Procedures
prepareStatement Help