autosave function in Ajax mode

橙三吉。 提交于 2019-12-22 11:27:54

问题


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"...

My question is...how execute this handler in Ajax Mode..so that the user don't refresh the current page?

Have someone any idea?


回答1:


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

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>

The event handler can now be called from CSJS with this code:

executeOnServer('autoSaveDoc',null,{ 'valmode': 0 })


来源:https://stackoverflow.com/questions/12971605/autosave-function-in-ajax-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!