getPos (NotesViewNavigator - JavaScript)

Returns the entry at a specified position in a view navigator.

Defined in

NotesViewNavigator

Syntax

getPos(pos:string, separator:char) : NotesViewEntry
Parameter Description
pos A position in decimal format, for example, 1.2.3 is the third child to the second child to the first entry using the period as a level separator.
separator The separator between position levels.
Return value Description
NotesViewEntry The entry at the specified position. Returns null if there is no entry at that position.

Usage

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

Examples

This button gets the entry at a view position input by a user.
var nav:NotesViewNavigator = database.getView("By category and date").createViewNav();
var pos:string = requestScope.query;
try {
	var entry:NotesViewEntry = nav.getPos(pos, ".");
} catch(e) {
	requestScope.status = "Incorrectly formed: " + pos;
	return;
}
if (entry != null) {
	if (entry.isDocument()) {
		requestScope.status = entry.getPosition(".") + " " +
		entry.getDocument().getItemValueString("subject");
	} else if (entry.isCategory()) {
		requestScope.status = entry.getPosition(".") + " " +
		entry.getColumnValues().elementAt(entry.getIndentLevel());
	} else {
		requestScope.status = entry.getPosition(".") + " " +
		entry.getColumnValues().elementAt(3);
	}
	
} else{
	requestScope.status = "Position " + pos + " is not valid in this view: ";
}