showCheckbox - Show Check Box
Displays a check box before the column content.
Category
formatSyntax
showCheckbox="true|false"
Usage
In Design mode, click the Display tab under Properties and look for Check box, or click All Properties and look for showCheckbox under format.By default, a column does not have a check box.
At run time, the
user can select one or more documents through the check boxes. The
following mechanisms access selected documents:
- In a script, the
getSelectedIds
method of theviewPanel
component returns a string array of the Note IDs of currently selected items. UsegetComponent
to get theviewPanel
component as an object. For example:getComponent("viewPanel1").getselectedIds()
- The
Delete Selected Documents
simple action deletes currently selected documents.
Examples
This view control has one column that displays with a checkbox.<xp:viewPanel rows="30" id="viewPanel1" pageName="/main2.xsp">
<xp:this.facets>
<xp:pager partialRefresh="true" layout="Previous Group Next"
xp:key="headerPager" id="pager1">
</xp:pager>
</xp:this.facets>
<xp:this.data>
<xp:dominoView var="view1" viewName="main"></xp:dominoView>
</xp:this.data>
<xp:viewColumn columnName="subject" id="viewColumn1"
displayAs="link" showCheckbox="true">
<xp:viewColumnHeader value="subject"
id="viewColumnHeader1">
</xp:viewColumnHeader>
</xp:viewColumn>
</xp:viewPanel>
This button executes a script that
gets documents selected in the above view and puts them in a folder.
<xp:button value="Put in Selected folder" id="button3">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:
var docids = getComponent("viewPanel1").getSelectedIds();
for (var id in docids) {
var doc:NotesDocument = database.getDocumentByID(id);
doc.putInFolder("Selected", true);
doc.recycle();
}
}]]></xp:this.action>
</xp:eventHandler></xp:button>
This button
executes a simple action that deletes documents selected in the above
view.
<xp:button value="delete documents" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:deleteSelectedDocuments view="viewPanel1"
message="Do you really want to delete these documents?">
</xp:deleteSelectedDocuments>
</xp:this.action></xp:eventHandler></xp:button>