XSP._isDirty() and/or enableModifiedFlag Does Not Work

淺唱寂寞╮ 提交于 2019-12-11 06:40:58

问题


Other posts refer to using XSP._isDirty() to trigger CSJS when form data has been changed and the user moves off of an XPage. Doesn't seem to be working with Domino 9.0.1 FP1. Earlier posts warned that it was a private function and may get removed.

Mastering XPages talks about using enableModifiedFlag for similar purpose (but this appears to be only for XPINC).

Any recommendations on how to warn a web browser user when they attempt to navigate away from an XPage that they will lose un-saved form data?


回答1:


You can also use CSJS to fire an alert, when the user is going to close the tab / browse another URL / close browser

Use the window.onbeforeunload event where you can define a function which checks if the document is changed



来源:https://stackoverflow.com/questions/26370405/xsp-isdirty-and-or-enablemodifiedflag-does-not-work

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