1 つ以上のオブジェクトのコンテンツを表示します。
カテゴリ
拡張ライブラリ
構文
<xe:dumpObject attributes>content</xe:dumpObject>
使用法
このコントロールは、デバッグツールとして使用します。
例
以下のページには、
afterPageLoad イベント、ボタン、ダンプオブジェクトコントロールが含まれています。このページが初めて開くと、アプリケーション内の最初の文書の NotesDocument オブジェクトが表示されます。ボタンをクリックすると、後続の文書が表示されます。
<xp:this.afterPageLoad>
<![CDATA[#{javascript:requestScope.doc = database.getAllDocuments().getNthDocument(1);
sessionScope.n = 1}]]>
</xp:this.afterPageLoad>
<xp:button value="Get next document" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="dumpObject1">
<xp:this.action><![CDATA[#{javascript:var n = ++sessionScope.n;
var doc:NotesDocument = database.getAllDocuments().getNthDocument(n);
if (doc == null) {
n = 1;
doc = database.getAllDocuments().getNthDocument(n);
}
requestScope.doc = doc;
sessionScope.n = n}]]>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:br></xp:br>
<xe:dumpObject id="dumpObject1" value="#{javascript:return requestScope.doc}">
<xe:this.title><![CDATA[#{javascript:if (requestScope.doc == null)
return "No document"
else
return "Document " + sessionScope.n
}]]>
</xe:this.title>
</xe:dumpObject>
以下のページは、アプリケーション内の最初の 2 つの文書の NotesDocument オブジェクトを表示します。
<xe:dumpObject id="dumpObject1" title="First two documents">
<xe:this.value>
<![CDATA[#{javascript:
return [database.getAllDocuments().getFirstDocument(), database.getAllDocuments().getNthDocument(2)]
}]]>
</xe:this.value>
</xe:dumpObject></xp:view>
以下のページは、アプリケーション内のすべての文書の NotesDocument オブジェクトを表示します。
<xe:dumpObject id="dumpObject1" title="All documents">
<xe:this.value>
<![CDATA[#{javascript:var dc:NotesDocumentCollection = database.getAllDocuments();
var doc:NotesDocument = dc.getFirstDocument();
var docs = new Array();
while (doc != null) {
docs.push(doc);
doc = dc.getNextDocument(doc);
}
return docs}]]>
</xe:this.value>
</xe:dumpObject>