小编Tom*_*row的帖子

NotesXSPDocument - 插入布尔值会破坏getDocument

我有一个XPage,由于(应该是什么)一个小的改变刚刚破坏.

如果我运行(其中document1是NotesXSPDocument数据源):

document1.replaceItem("ItemName", false); //or true, or any variable/formula that results in a boolean
Run Code Online (Sandbox Code Playgroud)

其次是:

document1.getDocument(true); 
Run Code Online (Sandbox Code Playgroud)

我最终得到了一个错误

[TypeError]调用方法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(&quot;Test&quot;,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>&#160;<xp:br></xp:br>document1.replaceItemValue(&quot;Test&quot;,&quot;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"); …
Run Code Online (Sandbox Code Playgroud)

lotus-domino xpages xpages-ssjs

2
推荐指数
1
解决办法
2467
查看次数

标签 统计

lotus-domino ×1

xpages ×1

xpages-ssjs ×1