Page 1 of 1

Refresh Author/Save button via Java

Posted: Fri Feb 21, 2025 10:53 pm
by aujunior
Hello,

We have implemented a scheduler in our framework to trigger an internal auto-save, allowing documents to be saved in our data management system.

This customization was necessary because Oxygen's autosave does not go through the editorAboutToBeSavedVeto event.

However, we encountered an issue with the "Author/Save" button. While the auto-save works correctly, the button remains enabled.

We attempted to use the DIRTY_STATUS listener, but when saving via Java, the frontend is not updated.

We would like to know if there is a way to set the DIRTY_STATUS via Java on the backend or if there is an option to update the "Author/Save" button status via Java.

Thank you in advance.

Re: Refresh Author/Save button via Java

Posted: Mon Feb 24, 2025 11:36 am
by mihaela
Hello,

There is a JAVA API available to set the editor as "modified" or "not modified":
ro.sync.exml.workspace.api.editor.WSEditorBase.setModified(boolean) [1]

If you have access to the AuthorDocumentModel (model), here is how you can set the document as "not modified":

Code: Select all

 model.getAuthorAccess().getEditorAccess().setModified(false); 
[1] https://www.oxygenxml.com/InstData/Edit ... d(boolean)

Best Regards,
Mihaela