createViewNavFromCategory (NotesView - JavaScript™)
Creates a view navigator for all entries in a view under a specified category.
Defined in
NotesViewSyntax
createViewNavFromCategory(categoryName:string) : NotesViewNavigator
createViewNavFromCategory(categoryName:string, cacheSize:int) : NotesViewNavigator
Parameter | Description |
---|---|
categoryName |
The name of a category in the view. |
cacheSize |
The size of the navigator cache in view entries. Legal values are 0 (no cache) through 128 (default). Applies only to remote (IIOP) operations. |
Return value | Description |
---|---|
NotesViewNavigator |
The new view navigator. |
Usage
The entries in the navigator are all the entries in the view under the specified category. The category entry itself is excluded.If the category does not exist, the result is an empty navigator. All navigation methods return null.
Subcategories can be specified using backslash notation (don't forget to escape the backslashes), for example, "Asia\\Korea" means the subcategory "Korea" under the main category "Asia." The cache enhances performance for iterative processing of entries using the navigation methods that do not take a parameter.
Examples
This button gets all the entries in a view for a specified category.var v:NotesView = database.getView("main");
var nav:NotesViewNavigator = v.createViewNavFromAllUnread();
if (nav.getCount() == 0) {
requestScope.status = "No unread documents";
return;
}
var entry:NotesViewEntry = nav.getFirst();
while (entry != null) {
requestScope.status += "\n" +
entry.getColumnValues().elementAt(0);
var tmpentry = nav.getNext();
entry.recycle();
entry = tmpentry;
}