Forums Register Login

modify..

+Pie Number of slices to send: Send
need to modify records in a jsp page..can anyone guide me as to what can be the proper logic of the same..
will show the records and against each a checkbox and when the user clicks the modify link..that particular record is available for modification..
please tell me how to solve this..
thanks
+Pie Number of slices to send: Send

You will get the request parameter "cb" containing the indices (from 1 up) with the selected rows as their values.
This examples shows only the first 100 entries from the minimum index.
[ March 17, 2004: Message edited by: Jeroen Wenting ]
+Pie Number of slices to send: Send
thanks..
bt iam working on jsp and ms-sql as the database..
how do i show that particular record..that the user has selected..for modifications..i have an id as the identity column..
thanks
+Pie Number of slices to send: Send
Jeroen..............
You have given an EXCELLENT Example for the beginner.
+Pie Number of slices to send: Send
It is better to give Radio Button instead of check box as you will be editing one record.If the records displayed in the loop,Give a particular id for the selected record and get the record displayed on clicking the edit button.pass the ID as hidden value.Then on the next jsp you get the value and display.on submitting you can fire an update query to database.
+Pie Number of slices to send: Send
simply map the row id retrieved from the JSP to the primary key for the database to retrieve the correct row.
Easiest way to do that is to read all the records you list initially into memory (or at the very least their primary keys) as objects (which you can then use in the list as well) and put them into a List.
The number(s) you retrieve from the JSP are then an index into that List (with an offset of 1).
+Pie Number of slices to send: Send
thanks..a lot everyone..
will try to solve this problem..in case any problem the ranch is always there..
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 997 times.
Similar Threads
Stateless web service and caching
recent entries from the database
code for modification
what is principal realm?
showing records for updating value after click on modify link on masterpage.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:40:43.