isExpanded setExpanded (NotesXspViewEntry - JavaScript™)
Indicates whether child entries are expanded.
Defined in
NotesXspViewEntry (JavaScript)Syntax
isExpanded() : boolean
setExpanded(boolean) : void
Return value and parameter | Description |
---|---|
boolean |
true if the entry is expanded; false otherwise |
Usage
Examples
This is the XML for a Button control embedded in a Data Table control with a Domino® view data source whose collection name isrowdata
. The button has a script to hide it if
the row has no descendants. Another script sets the button label to
"Expand??? or "Collapse??? depending on the state of the current row.
Finally the onclick
event for the button toggles
the state of the current row.<xp:button id="button1">
<xp:this.rendered><![CDATA[#{javascript:rowdata.getDescendantCount() > 0}]]></xp:this.rendered>
<xp:this.value><![CDATA[#{javascript:if (rowdata.isExpanded()) {
return "Collapse"
} else {
return "Expand"
}}]]></xp:this.value>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:rowdata.toggleExpanded()}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
This example is the same as the first
but exercises
setExpanded
.<xp:button id="button1">
<xp:this.rendered><![CDATA[#{javascript:rowdata.getDescendantCount() > 0}]]></xp:this.rendered>
<xp:this.value><![CDATA[#{javascript:if (rowdata.isExpanded()) {
return "Collapse"
} else {
return "Expand"
}}]]></xp:this.value>
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:if (rowdata.isExpanded()) {
rowdata.setExpanded(false)
} else {
rowdata.setExpanded(true)
}}]]></xp:this.action>
</xp:eventHandler>
</xp:button>