AuthorEditorAccess.refresh(node) not working inside WSEditorListener.editorAboutToBeSavedVeto
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 31
- Joined: Fri Jan 26, 2024 3:31 pm
AuthorEditorAccess.refresh(node) not working inside WSEditorListener.editorAboutToBeSavedVeto
Post by vitorhugovm »
Hello!
I'm trying to perform a refresh in some specific nodes before a document is saved by extending WSEditorListener and overriding the function editorAboutToBeSavedVeto. Inside the overwritten function, some nodes are located by XPath and then an attempt to refresh their CSS is made by using AuthorEditorAccess.refresh(AuthorNode) . Unfortunately nothing happens and the node is not refreshed. Is there any blockage occurring during this process? We are using a framework instead of a plugin.
Thanks!
Vitor
I'm trying to perform a refresh in some specific nodes before a document is saved by extending WSEditorListener and overriding the function editorAboutToBeSavedVeto. Inside the overwritten function, some nodes are located by XPath and then an attempt to refresh their CSS is made by using AuthorEditorAccess.refresh(AuthorNode) . Unfortunately nothing happens and the node is not refreshed. Is there any blockage occurring during this process? We are using a framework instead of a plugin.
Thanks!
Vitor
Re: AuthorEditorAccess.refresh(node) not working inside WSEditorListener.editorAboutToBeSavedVeto
Hello,
Can you please explain more about your use-case? The refresh will only change the rendering of the element and it will not affect the XML source before saving the document.
Best Regards,
Mihaela
Can you please explain more about your use-case? The refresh will only change the rendering of the element and it will not affect the XML source before saving the document.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 31
- Joined: Fri Jan 26, 2024 3:31 pm
Re: AuthorEditorAccess.refresh(node) not working inside WSEditorListener.editorAboutToBeSavedVeto
Post by vitorhugovm »
Hello Mihaela!
The reason why I want to refresh the node before saving is so a custom renderer could be recalled through oxy_editor in CSS.
I've used the refresh function like this in another cases and it works, but when I use it inside the listener, the custom renderer class is never called.
I'm not sure if the node is really not being refreshed, but this class inside oxy_editor CSS function is definitely not running in this specific moment.
Thanks!
Vitor
The reason why I want to refresh the node before saving is so a custom renderer could be recalled through oxy_editor in CSS.
I've used the refresh function like this in another cases and it works, but when I use it inside the listener, the custom renderer class is never called.
I'm not sure if the node is really not being refreshed, but this class inside oxy_editor CSS function is definitely not running in this specific moment.
Thanks!
Vitor
-
- Site Admin
- Posts: 163
- Joined: Tue Mar 20, 2018 5:28 pm
Re: AuthorEditorAccess.refresh(node) not working inside WSEditorListener.editorAboutToBeSavedVeto
Post by Bogdan Dumitru »
Hello Vitor,
Document changes made within WSEditorListener.editorAboutToBeSavedVeto aren't propagated to the browser directly. The save request doesn't return to the client document updates.
As a workaround you can move your code from WSEditorListener.editorAboutToBeSavedVeto to a custom AuthorOperation and invoke the operation when document gets saved.
When document is saved the sync.api.EditingSupport.EventType.DIRTY_STATUS_CHANGED event is dispatched, so you have to add a DIRTY_STATUS_CHANGED listener and when dirty status gets clean you have to invoke your AuthorOperation.
To invoke an operation see sync.api.ActionsManager.invokeOperation.
Document changes made within WSEditorListener.editorAboutToBeSavedVeto aren't propagated to the browser directly. The save request doesn't return to the client document updates.
As a workaround you can move your code from WSEditorListener.editorAboutToBeSavedVeto to a custom AuthorOperation and invoke the operation when document gets saved.
When document is saved the sync.api.EditingSupport.EventType.DIRTY_STATUS_CHANGED event is dispatched, so you have to add a DIRTY_STATUS_CHANGED listener and when dirty status gets clean you have to invoke your AuthorOperation.
To invoke an operation see sync.api.ActionsManager.invokeOperation.
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service