我有一个XPage,由于(本来应该是)一个小小的改变而刚刚破解。NotesXSPDocument - 插入一个布尔值休息getDocument
如果我运行(其中文档1是NotesXSPDocument数据源):
document1.replaceItem("ItemName", false); //or true, or any variable/formula that results in a boolean
后跟:
document1.getDocument(true);
我最终发生了错误
[类型错误]异常调用方法NotesXspDocument.getDocument(boolean)null
这是一个新的文档(所以还没有保存,我还没有测试过,但可能会有所作为),因此我不能只在底层文档上设置字段。
它似乎不是页面中其他任何东西的人工产物,因为基本测试页确认了它。除了布尔值之外,它不会发生任何事情(我发现)。
任何意见,除了只是改变数据类型?我想这就是我最终会做的事(连同一个错误报告),但我想知道我不会错过任何东西。
感谢
------------测试XSP代码------------
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"><xp:this.data>
<xp:dominoDocument var="document1" formName="Test" />
</xp:this.data><xp:span style="font-weight:bold">
Button 1 code:</xp:span><xp:br></xp:br>document1.replaceItemValue("Test",false);
<xp:br></xp:br>var doc:NotesDocument = document1.getDocument(true);
<xp:br></xp:br>print(doc.toString());<xp:br></xp:br>
<xp:button value="Test 1" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:document1.replaceItemValue("Test",false);
var doc:NotesDocument = document1.getDocument(true);
print(doc.toString());}]]></xp:this.action>
</xp:eventHandler></xp:button>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:br></xp:br><xp:span style="font-weight:bold">
Button</xp:span><xp:span style="font-weight:bold"> 2</xp:span><xp:span style="font-weight:bold"> Code:</xp:span><xp:span style="font-weight:bold"></xp:span> <xp:br></xp:br>document1.replaceItemValue("Test","Test);<xp:br></xp:br>var doc:NotesDocument = document1.getDocument(true);
<xp:br></xp:br>print(doc.toString());<xp:br></xp:br><xp:button value="Test 2" id="button2">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:document1.replaceItemValue("Test","Test");
var doc:NotesDocument = document1.getDocument(true);
print(doc.toString());}]]></xp:this.action>
</xp:eventHandler></xp:button></xp:view>
数字。我想我必须使用一个数字来代替。我并不是真的把它设置为假,只是为了测试/例子。 –
+1,布尔值不是合法的Notes项目类型。按照惯例,它应该是0/1(数字)或“”/“1”(字符串)。 –