• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Open selected table row in edit mode in JSP using javascript

 
Pall Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pall Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20746
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks To All
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic