gotoNextCategory (NotesViewNavigator - JavaScript)

Moves the current pointer to the next category entry of the current entry in a view navigator.

Defined in

NotesViewNavigator

Syntax

gotoNextCategory() : boolean
Return value Description
boolean
  • true if the operation succeeds
  • false if there is no next category entry

Examples

This button gets a category view entry by number where 1 is the first category and -1 is the last category.
var nav:NotesViewNavigator = database.getView("By category and date").createViewNav();
if (nav.getCount() == 0) return;
// User enters a number in the input box bound to requestScope.query
var n:int = parseInt(requestScope.query);
if (isNaN(n) || n == 0) n = 1;
// For positive number, get the nth category where 1 is the first category
if (n > 0) {
	nav.gotoFirst();
	for (var i = 1; i < n; i++) {
		nav.gotoNextCategory();
	}
// For negative number, get the -nth category where -1 is the last category
} else {
	nav.gotoLast();
	for (var i = 0; i > n; i--) {
		nav.gotoPrevCategory();
	}
}
entry = nav.getCurrent();
requestScope.status += "\n" + entry.getPosition(".") + " ";
requestScope.status += entry.getColumnValues().elementAt(entry.getIndentLevel());