Click to See Complete Forum and Search --> : Listing w/ next button in javascript


pankem
06-22-2004, 10:09 AM
I have this array that is alrady populated in the jsp page, lets jsut call it "temp" for now.

temp is a multdemesnional array. Now tem also has like 2k objects in it and it takes the page forever to iterate through it to display it all (using the <logic:itereate> tag).

So what I need help with is writing a javascript code so that only 20 items will be shown at once, and if the user hits next the next 20 items will be shown. I cann ot figur eout how to do this without refreshing the page each time and having a session variable. I know there is a way do do this in javascript but I cannot figure out how.

Khalid Ali
06-22-2004, 11:34 AM
if you want to use JavaScript then you will need to create an array of values from your struts/jsp tags(that will involve <logic:iterate>.But it will just print the text on the page.
Once that is done successfully then you use javaScrit array simply by controlling its length.