Click to See Complete Forum and Search --> : NEXT/PREVIOUS Buttons
gnanesh
05-20-2003, 01:40 PM
folks
i have an search module where in i will be showing around 1000 records at a time, I need to control this i mean i want to show user only 50 records at a time, If any one knows how to do it, I appreciate it would be very helpful if you post the code, this is an JSP application, I don't mind doing that using Javascript
let me know about this
thanks
gnanesh
Are you pulling from a database? If so, can't you just limit the results sent? Something like this SQL command:
SELECT name FROM table LIMIT 50
khalidali63
05-20-2003, 01:54 PM
This is what you can do.
1. Get all the records in a Collection in your jsp once running the query.
2. from this collection first off create html page using fifty records.
3.Whn clicked next submit the page to the same jsp page and red create html page with next 50 records and ....I guess yout the idea..right..:D
gnanesh
05-20-2003, 01:57 PM
If you have any code , can you post it ,
thanks
gnanesh
khalidali63
05-20-2003, 02:12 PM
I don't have anything ready made,butlet me understand.
You must already have jsp code ready that runs a query to DB and gets a records???
the only things from this point on you need to do is to put a record in a Collection.
List records = new ArrayList();
while(recordset.next()){
String record = String.valueOf(records.getString("colName");
records.add(record);
}
//at this point you have all the records in the collection.
I am sure you are already aware of creating html part of the code using jsp..
loop through the list for 50 recs....
and then rest will be the same as I posted above