In order to use Viewpoint's built-in queue system, a page may call the setQueue JavaScript method or specify a queue URL parameter when querying for the page. Each queue must have a unique ID, and pages that share a queue should share this ID.
When the page uses Viewpoint's queue, two major changes happen:
To utilize Viewpoint's queue
Object | Description |
---|---|
display |
Defines how the queue items should be displayed and contains two child objects:
|
>values | Contains a mapping of key, value pairs for the data stored on a single queue item. |
qty | (Optional) Since each item in the queue may have an associated quantity, this attribute defines the quantity for this queue item. If not specified, the default value of 1 is used. |
var display = new Object();
display.description = "Image: " + image + "
vCPU: " + procs + "
RAM: " + mem + " GB
Disk: " + disk + " GB";
display.summary = image + ": " + procs + " vCPU, " + mem + " GB RAM, " + disk + " GB HD";
var myObject = new Object();
myObject.values = {
"image" : image,
"procs" : procs,
"mem" : mem,
"disk" : disk
};
myObject.display = display;
top.addQueueItem(myObject);
This method is necessary since the Viewpoint framework allows users to remove items and update quantities outside of the form page. Therefore it is recommended to let Viewpoint keep track of the queue completely, and your page should only query for the information when it is ready to perform the action.
top.changePlace("Local;page=custom/your_form;queue=vc;showTable=true");
The buttons takes the user to the request table page.
Related topics