Getting Started | Class Index

Classes


Class Qv.Document.Bookmarks

The Bookmarks object.

Class Summary
Constructor Attributes Constructor Name and Description
 
Object for bookmark operations
Method Summary
Method Attributes Method Name and Description
 
Delete a bookmark with the given bookmark id.
 
NewBookmark(name, additive, share, excludeselections, layoutstate, hide, showpopupinfo, infomsg, inputfieldvaluesflag)
Create a new bookmark
 
Apply a bookmark.
Class Detail
Qv.Document.Bookmarks
Object for bookmark operations
Example:
var myBookmarkRenderer = {};
var MyDoc;
var MyBookmarks;
var MySelect;

myBookmarkRenderer.Paint = function () {
    
    MyBookmarks = MyDoc.Bookmarks().BookMarks;

    //Set the number of items in the drop down to the number of bookmarks
    MySelect.options.length = MyBookmarks.length;

    //loop through each bookmark
    for (var i = 0; i < MyBookmarks.length; i++) {
        var option = MySelect.options[i];
        option.text = MyBookmarks[i].text;
        option.value = MyBookmarks[i].value;
    }
}

Init = function () {
    //References a HTML dropdown control
    MySelect = document.getElementById("bmks");

    MyDoc = Qv.GetDocument('FilmsWebView');

    //If there's a change to the bookmarks, then myBookmarkRenderer will run
    MyDoc.AddBookmarkPaint(myBookmarkRenderer);    
}

function applyBookmark() {
    //Get the bookmark's id from the selected item in the drop down
    MyDoc.Bookmarks().SelectBookmark(MySelect.options[MySelect.selectedIndex].value);
    
    //Alternatively, you can pass the bookmark id
    //MyDoc.Bookmarks().SelectBookmark("Document\BM01");
}

function createBookmark() {
    var bookmarkName = MyBookMarkName.value;
    MyDoc.Bookmarks().NewBookmark("my bookmark",false,true,false,false,
                                    false,true,"shows sales trends in USA",false);
}

function deleteBookmark() {
    //Get the bookmark's id from the selected item in the drop down
    MyDoc.Bookmarks().DeleteBookmark(MySelect.options[MySelect.selectedIndex].value);
    
    //Alternatively, you can pass the bookmark id
    //MyDoc.Bookmarks().DeleteBookmark("Document\BM01");
}

Qv.InitWorkBench(
    { 
        View: 'FilmsWebView', 
        BodyOnLoadFunctionNames: ['Init'] 
    });
Method Detail
{void} DeleteBookmark(id)
Delete a bookmark with the given bookmark id.
    var MyDoc = Qv.GetDocument("FilmsWebView");
    MyDoc.Bookmarks().DeleteBookmark("Document\BM01");
Parameters:
{String} id
The id of the bookmark you want to delete.

{void} NewBookmark(name, additive, share, excludeselections, layoutstate, hide, showpopupinfo, infomsg, inputfieldvaluesflag)
Create a new bookmark
    var bookmarkName = MyBookMarkName.value;
    MyDoc.Bookmarks().NewBookmark("my bookmark",false,true,false,false,
    false,true,"shows sales trends in USA",false);
Parameters:
{String} name
Name of the bookmark.
{Boolean} additive
The bookmark is applied on top of any previous selections (no clear).
{Boolean} share
Share the bookmark with other users.
{Boolean} excludeselections
Exclude the selections made in the application.
{Boolean} layoutstate
Include state of all objects.
{Boolean} hide
The bookmark is not displayed in the bookmark list but is still selectable in code or via url.
{Boolean} showpopupinfo
The bookmark description will be shown in a message when the bookmark is selected.
{String} infomsg
Description of the bookmark.
{Boolean} inputfieldvaluesflag
Include values in input fields.

{void} SelectBookmark(id)
Apply a bookmark.
    var MyDoc = Qv.GetDocument("FilmsWebView");
    MyDoc.Bookmarks().SelectBookmark("Document\BM01");
Parameters:
{String} id
The id of the bookmark you want to apply.