使用8.5.3 UP1
当我从对话框中保存我的文档时,某些字段没有被填充.如果我从xpage中保存文档,它会保存这些字段.这是一个简单的例子来说明这个问题:
<xp:link text="Save Document By Dialog"
id="link21">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[XSP.openDialog("#{id:dialog1}");]]></xp:this.script>
</xp:eventHandler>
</xp:link>
<br/>
<xp:button value="Save By Button" id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xe:dialog id="dialog1" title="Dialog">
<br />
<b>
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:"Save this document?"}]]></xp:this.value>
</xp:text>
</b>
<br />
<br />
<xp:button value="Yes" id="button7">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.script><![CDATA[XSP.closeDialog("#{id:dialog1}");]]></xp:this.script>
<xp:this.action>
<xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action></xp:eventHandler>
</xp:button>
<xp:button value="No" id="button8">
<xp:this.onclick><![CDATA[XSP.closeDialog("#{id:dialog1}");]]></xp:this.onclick>
</xp:button>
</xe:dialog>
<br/><br/>
<xp:inputText id="TitleTX" value="#{document1.TitleTX}"></xp:inputText>
<br/><br/>
<xp:inputRichText id="inputRichText1" value="#{document1.ProcessMapsRT}">
</xp:inputRichText>
Run Code Online (Sandbox Code Playgroud)
与xe:对话框关联的DOJO进程将对话框移动到DOM中的另一个位置,这意味着它将松散跟踪文档主要部分中的数据源.如果您使用SSJS保存对话框而不是简单的操作,它可能会更好地工作.
我使用自定义控件中包含的对话框获得了最大的成功,其中数据源通过复合数据传入.这样,与数据的连接不会丢失并仍然有效,但是,我仍然使用SSJS来保存这些情况.
/ Newbs
更新:这可能是使用Steve Pridemore在NotesIn9#42中描述的技术的时间(参见xpages.tv).
首先将新事件放入XPage中,并在其中包含数据源.
<xp:eventHandler
id="saveEventHandler"
submit="true"
save="true"
event="calledbyid"
refreshMode="complete">
</xp:eventHandler>
Run Code Online (Sandbox Code Playgroud)
接下来,让对话框中的操作使用客户端javascript调用此事件:
XSP.executeOnServer('#{id:saveEventHandler}')
Run Code Online (Sandbox Code Playgroud)
那"应该"做到了.我没有完全测试它,但NoteIn9的例子确实有效.
/ Newbs
| 归档时间: |
|
| 查看次数: |
1807 次 |
| 最近记录: |