IsDefaultView (NotesView - JavaScript™)
Read-write. Indicates whether a view is the default view of the database.
Defined in
NotesViewSyntax
isDefaultView() : boolean
setDefaultView(flag:boolean) : void
Legal value | Description |
---|---|
true |
if the view is the default view |
false |
if the view is not the default view |
Examples
This computed field prints the name of the default view or a message that there is none.var views = database.getViews().iterator();
while (views.hasNext()) {
var v = views.next();
if (v.isDefaultView()) {
return v.getName() + " is the default view."
}
}
return "There is no default view."
This combo box (complete
XML shown) displays the names of all views in the current database,
default view first. If the user selects another view from the list,
that view is set as the default.
<xp:comboBox id="comboBox1" value="#{requestScope.selectedview}">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:
var views = database.getViews().iterator();
var viewNames = new Array();
var viewDefaultName = new Array();
while (views.hasNext()) {
var v:NotesView = views.next();
if (v.isDefaultView()) {
viewDefaultName.push(v.getName());
} else {
viewNames.push(v.getName());
}
}
return viewDefaultName.concat(viewNames);
}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:
var v:NotesView = database.getView(requestScope.selectedview);
v.setDefaultView(true);
}]]></xp:this.action>
</xp:eventHandler></xp:comboBox>