getPrevSibling (NotesViewNavigator - JavaScript)

Returns the previous sibling entry of the current or specified entry in a view navigator.

Defined in

NotesViewNavigator

Syntax

getPrevSibling() : NotesViewEntry

getPrevSibling(entry:NNotesViewEntry) : NotesViewEntry

Parameter Description
entry An entry in the view. Cannot be null.
Return value Description
NotesViewEntry The sibling entry preceding the current or specified entry. Returns null if there is no previous sibling entry.

Usage

This method moves the current pointer to the retrieved entry unless the return value is null.

Examples

This button gets all the first-level category entries in a categorized view in reverse order.
var nav:NotesViewNavigator = database.getView("By category").createViewNav();
var entry:NotesViewEntry = nav.getLast();
do {
	entry = nav.getCurrent();
} while (nav.gotoParent());
while (entry != null) {
	if (!entry.isTotal()) {
		requestScope.status += "\n" +
		entry.getPosition(".") + " " +
		entry.getColumnValues().firstElement().toString() + " has" +
		entry.getDescendantCount().toFixed() + " total entries";
	}
	var tmpentry:NotesViewEntry = nav.getPrevSibling(entry);
	entry.recycle();
	entry = tmpentry;
}