Ordering pictures on a page from a Web-based DB, redux

Ordering pictures on a page from a Web-based DB, redux

Hi. With reference to Ordering pictures on a page from a Web-based DB, I have many images that are linked to one document. How can I accomplish the paging control? Is it possible to do it within the computed value?

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

It's a complex question. Since you can't predict how many documents you need to get nine images, just using a view like I suggested before won't be enough.

I suggest using DHTML to do the displaying. Your JavaScript code can calculate the HTML for the set of images you want to display at the same time, and you can add navigation controls that recalculate the HTML to show a different set of images. To get the data that the JavaScript code will need to do its work, you'll need to pull data from the view and get it into a form that JavaScript can use. Ideally, you want to generate something like this:

var imageData = new Array( 
"repo01.gif|4567B430AE211383775E10293ADB2880", 
"repo02.gif|4567B430AE211383775E10293ADB2880", 
"tvalve.jpg|8349384B60DB495E6868E9FBF1C49843", 
... 
); 
Then your JavaScript code can use Array.length to find out how many pictures there are and use the contents of the array to generate the HTML for pictures, say, #9 thru 17 or whatever you are displaying. The question is: How do you get the view data into the JavaScript code?

Click here for the rest of the answer.

Do you have comments on this Ask the Expert Q&A? Let us know.

This was first published in March 2004