getPrev (NotesViewNavigator - JavaScript)

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

Defined in

NotesViewNavigator

Syntax

getPrev() : NotesViewEntry

getPrev(entry:NotesViewEntry) : NotesViewEntry

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

Usage

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

Examples

This button gets all the entries in a categorized view in reverse order.
var v:NotesView = database.getView("By category and date");
var nav:NotesViewNavigator = v.createViewNav();
var entry:NotesViewEntry = nav.getLast();
while (entry != null) {
	if (entry.isDocument()) {
		requestScope.status += "\n" + "\t" +
		entry.getColumnValues().elementAt(2).toString();
	} else if (entry.isCategory()) {
		requestScope.status += "\n" +
		entry.getColumnValues().elementAt(entry.getIndentLevel()).toString();
	}
	var tmpentry:NotesViewEntry = nav.getPrev(entry);
	entry.recycle();
	entry = tmpentry;
}