File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Open selected table row in edit mode in JSP using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Open selected table row in edit mode in JSP using javascript" Watch "Open selected table row in edit mode in JSP using javascript" New topic
Author

Open selected table row in edit mode in JSP using javascript

Pall Jain
Greenhorn

Joined: Dec 27, 2011
Posts: 4
Hello Guys,

I am retrieving table containing date from oracle database,
now i wish to click on any row of the table and wants it to open in edit mode on another JSP page and than to run an update query into the database so that the row content can be updated.

Problem i am facing is i am not sufficient good to open the row data using JAVASCRIPT. So Kindly Help me.
Leonardo Jose Gomes da Silva
Greenhorn

Joined: Dec 26, 2011
Posts: 7

Pall Jain wrote:Hello Guys,

I am retrieving table containing date from oracle database,
now i wish to click on any row of the table and wants it to open in edit mode on another JSP page and than to run an update query into the database so that the row content can be updated.

Problem i am facing is i am not sufficient good to open the row data using JAVASCRIPT. So Kindly Help me.



Hey man!

Do you wanna open another window to edit the data? Or do you wanna edit data on the same window, like enabling the fields?


Hugs


Don't matter if your code are running, it need to be organized and well done!

Leonardo J. G. Silva
Analyst/Developer
Pall Jain
Greenhorn

Joined: Dec 27, 2011
Posts: 4
Yes Sir,
I want to open a new window,
the problem i am facing is, i cannot send selected row data into a new jsp page using javascript.

Sriram Ture
Greenhorn

Joined: Aug 20, 2010
Posts: 23
Hi Pall,


You can populate the data in pop-up window using java script.

But i would suggest you to go and fetch the row data from the database and populate the data in pop-up window.


Regards,
Sriram
Pall Jain
Greenhorn

Joined: Dec 27, 2011
Posts: 4
Thanks Sir,

But how would i fetch the same row from database on which click is done, because i am using resultset to display the data.
Actually i am really confused...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

When you click on the row, the request you send to the server should include the row number, or the key value for the row. Something which will allow the servlet to which you send the request to be able to find that row.
Leonardo Jose Gomes da Silva
Greenhorn

Joined: Dec 26, 2011
Posts: 7

Pall Jain wrote:Yes Sir,
I want to open a new window,
the problem i am facing is, i cannot send selected row data into a new jsp page using javascript.



Hey, Pall Jain

You can do something like that:




So, when you'll edit some row, you can do three things:

1º - Put a button in row, and that button redirect to your jsp or servlet, passing the code for do the research.
2º - Using a link on every rows of your table, redirecting to your jsp or servlet, passing the code for do the research.
3º - You can make a javascript code to insert de id of row selected, when the row is selected, look the example:




And your JSP:



Hugs
Pall Jain
Greenhorn

Joined: Dec 27, 2011
Posts: 4
Thanks To All
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Open selected table row in edit mode in JSP using javascript