在阿贾克斯模式自动保存功能 [英] autosave function in Ajax mode
问题描述
我会意识到每一个XPages中使用Notes文档Datasouces具有自动保存的funcionality(如谷歌邮件)
I would realize a custom control for every XPages with a Notes Document Datasouces that have autosave funcionality (like google mail)
这样的事件处理程序是无验证......
So that the event-handler is with "no validation"...
我的问题是...如何在阿贾克斯Mode..so执行该处理程序,用户不要刷新当前页面?
My question is...how execute this handler in Ajax Mode..so that the user don't refresh the current page?
让别人什么想法?
推荐答案
是的,你可以用好老CSJS的 executeOnServer 的方法这一点。该方法可以在这里找到:的http://xpages.info/XPagesHome.nsf/Entry.xsp?documentId=88065536729EA065852578CB0066ADEC
Yes, you can use the good old CSJS executeOnServer method for this. The method can be found here: http://xpages.info/XPagesHome.nsf/Entry.xsp?documentId=88065536729EA065852578CB0066ADEC
要禁用,你必须参数的 valmode = 0 的添加到局部刷新验证。这将禁用验证器和转换器。
To disable the validation you have to add the parameter valmode=0 to the partial refresh. This disables validators AND converters.
这是事件处理程序应该是什么样子:
This is how the event handler should look like:
<xp:eventHandler event="autoSaveEvent" id="autoSaveDoc" submit="false">
<xp:this.action>
<xp:saveDocument />
</xp:this.action>
</xp:eventHandler>
事件处理程序现在可以称之为从CSJS与此code:
The event handler can now be called from CSJS with this code:
executeOnServer('autoSaveDoc',null,{ 'valmode': 0 })
这篇关于在阿贾克斯模式自动保存功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!