• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

providing edit, delete options to a table

 
shanti jarnala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am implementing an application which displays the rows of oracle table in a jsp page by connecting to database using JDBC. I am done with it and now I need to provide edit and delete options to each and every row of my table in jsp. So I got an idea of providing with edit, delete buttons for each and every row. but if the table is too big this method is not good. another idea is to provide all the rows with check boxes so that user can check those boxes and then he can use edit or delete buttons (which are declared globally for the table...not for each row).
I need help in this..If you have any idea please share.
Thanks,
Shanti.
 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe its better if you will display a portion of a table first and a checkbox to the coresponding row. the checkbox will be the que on which rows will be deleted/edited in the database in
 
shanti jarnala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast reply.
Do you have any idea of how to add check box functionality to my existing table. and moreover if I select one row and click edit...how can I get only those row values into the next page?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"shanti jr",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
first change your name here(JAVARANCH Forum as it is required) then on your checkboxes, put a value of the unique column from your database when you populate your database. when you click either the edit or delete button it should query or delete the said row.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shanti jr:
Thanks for the fast reply.
Do you have any idea of how to add check box functionality to my existing table. and moreover if I select one row and click edit...how can I get only those row values into the next page?


- insert one more column to your table for checkboxes
- map each checkbox to record id
- get the checkbox value at the server. If unchecked you would get null, otherwise record id
- do whatever you want to do with that particular record. You can open up that record in edit mode in the next page or you can just delete that record and display the same page again.

Cheers.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic