Qv.Document.Bookmarks

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'] 
});

Methods

DeleteBookmark(id)

Delete a bookmark with the given bookmark id.
Parameters:
NameTypeDescription
idStringThe id of the bookmark you want to delete.
Example
var MyDoc = Qv.GetDocument("FilmsWebView");
    MyDoc.Bookmarks().DeleteBookmark("Document\BM01");

NewBookmark(name, additive, share, excludeselections, layoutstate, hide, showpopupinfo, infomsg, inputfieldvaluesflag)

Create a new bookmark
Parameters:
NameTypeDescription
nameStringName of the bookmark.
additiveBooleanThe bookmark is applied on top of any previous selections (no clear).
shareBooleanShare the bookmark with other users.
excludeselectionsBooleanExclude the selections made in the application.
layoutstateBooleanInclude state of all objects.
hideBooleanThe bookmark is not displayed in the bookmark list but is still selectable in code or via url.
showpopupinfoBooleanThe bookmark description will be shown in a message when the bookmark is selected.
infomsgStringDescription of the bookmark.
inputfieldvaluesflagBooleanInclude values in input fields.
Example
var bookmarkName = MyBookMarkName.value;
    MyDoc.Bookmarks().NewBookmark("my bookmark",false,true,false,false,
    false,true,"shows sales trends in USA",false);

SelectBookmark(id)

Apply a bookmark.
Parameters:
NameTypeDescription
idStringThe id of the bookmark you want to apply.
Example
var MyDoc = Qv.GetDocument("FilmsWebView");
    MyDoc.Bookmarks().SelectBookmark("Document\BM01");