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
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 ]
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
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.
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).