Prompting users to save changes to XPages
You can control how an XPage application prompts the user when the user requests an action that closes a page with modified fields.
About this task
- Level 1: XPage or custom control
- enableModifiedFlag (boolean - default implicit value is false) – Specifies whether to prompt the user to save changes to core controls in the XPage or custom control, and whether to enable the Notes® client option when the XPage or control has been modified in the Notes® client. Applications running in an external browser cannot use the Notes® mechanism, so only the prompt dialog is displayed to the user.
- modifiedMessage (string) – A custom message to display in the prompt dialog
- Level 2: Core control
- disableModifiedFlag (boolean - default implicit value is true) – Specifies whether to prompt the user to save changes to the core control
- Edit Box
- Multiline Edit Box
- List Box
- Combo Box
- Check Box
- Radio Button
- File Upload
- Date Time Picker
- Rich Text Editor
If the user chooses not to save modifications to the current page, the requested action (such as closing the page, or navigating away from it in a browser) can execute. If the user chooses to save modifications, the related fields are validated before the page is saved. The validation occurs first on the client and then on the server. Only when client-side validation of the current page fields is successful can server-side validation occur. If server-side validation fails, the user is presented with the current page containing the offending fields and given the opportunity to correct the field content. Once server-side validation succeeds, the requested action can execute.