Save button state refresh
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Save button state refresh
Hello,
I am using Author web 25.0.0.0 but I have the same behaviour in 24 version.
When I open a document for the first time, the "Save" button is disabled.
If I put the cursor in a text node and I add another character, the "Save" button stays disabled.
In order to make the "Save" button enabled, I have to :
- Add a second character
OR
- Put my cursor at another place in the editor
Why does the "Save" button become enabled after the second character added and not from the first one ?
In the same way, when I save the document (after a change) by clicking the "Save" button or with CTRL + S, the save button remains enabled.
It becomes disabled when I click in the editor view.
Thank you for your help,
Johann
I am using Author web 25.0.0.0 but I have the same behaviour in 24 version.
When I open a document for the first time, the "Save" button is disabled.
If I put the cursor in a text node and I add another character, the "Save" button stays disabled.
In order to make the "Save" button enabled, I have to :
- Add a second character
OR
- Put my cursor at another place in the editor
Why does the "Save" button become enabled after the second character added and not from the first one ?
In the same way, when I save the document (after a change) by clicking the "Save" button or with CTRL + S, the save button remains enabled.
It becomes disabled when I click in the editor view.
Thank you for your help,
Johann
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Save button state refresh
Post by Bogdan Dumitru »
Hello Johann,
Unfortunately, we don't reproduce the issue you're describing.
What would help us to reproduce the problem or at least to better understand it:
It doesn't, or at least it shouldn't.Why does the "Save" button become enabled after the second character added and not from the first one ?
Unfortunately, we don't reproduce the issue you're describing.
What would help us to reproduce the problem or at least to better understand it:
- What is your environment?
- what browser are you using?
- do you have any browser extensions installed?
- what OS are you using?
- do you use or have installed any IME?
- Do you reproduce on our public demo server too?
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Re: Save button state refresh
Hello Bogdan,
Indeed it works on your demo server.
There is an important difference in my framework that explains this difference in behaviour.
I needed to customize the toolbars displayed in Author web so I first "deleted" the "Builtin" toolbar in javascript:
Then I added in my framework file the "Save" button:
If I go back to the "Builtin" toolbar I actually don't have the problem anymore.
Why doesn't the Save button react the same way when added manually in the toolbars?
Thank you,
Johann
Indeed it works on your demo server.
There is an important difference in my framework that explains this difference in behaviour.
I needed to customize the toolbars displayed in Author web so I first "deleted" the "Builtin" toolbar in javascript:
Code: Select all
var builtinToolbar=null;
if(actionsConfig.toolbars){
for(vari=0;i<actionsConfig.toolbars.length;i++){
vartoolbar=actionsConfig.toolbars[i];
if(toolbar.name==="Builtin"){
builtinToolbar=toolbar;
}
}
}
if(builtinToolbar){
builtinToolbar.children=[];
}
Code: Select all
<field name="toolbarDescriptor">
<toolbar>
<field name="id">
<String>author_xml_switch_toolbar</String>
</field>
<field name="type">
<Integer>2</Integer>
</field>
<field name="toolbarEntriesDescriptorList">
<toolbarEntry-array>
<toolbarItem>
<field name="actionID">
<String>Author/ShowXML</String>
</field>
</toolbarItem>
</toolbarEntry-array>
</field>
</toolbar>
</field>
<field name="additionalToolbarsDescriptors">
<toolbar-array>
<toolbar>
<field name="id">
<String>author_core_actions_toolbar</String>
</field>
<field name="type">
<Integer>2</Integer>
</field>
<field name="toolbarEntriesDescriptorList">
<toolbarEntry-array>
<toolbarItem>
<field name="actionID">
<String>Author/Undo</String>
</field>
</toolbarItem>
<toolbarItem>
<field name="actionID">
<String>Author/Redo</String>
</field>
</toolbarItem>
<toolbarItem>
<field name="actionID">
<String>Author/Save</String>
</field>
</toolbarItem>
</toolbarEntry-array>
</field>
</toolbar>
</toolbar-array>
</field>
Why doesn't the Save button react the same way when added manually in the toolbars?
Thank you,
Johann
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Save button state refresh
Post by Bogdan Dumitru »
Hi Johann,
Looking at the code snippet you sent, it seems that you removed with no mercy all of the actions from Web Author's application toolbar (the black one).
If you wanted to hide the app bar, there is another way to do this, see "workspace.getViewManager().hideAppBar()" from the Integrating Web Author in a CMS or Another Application topic.
Would it suffice to use the "hideAppBar()" method?
Looking at the code snippet you sent, it seems that you removed with no mercy all of the actions from Web Author's application toolbar (the black one).
If you wanted to hide the app bar, there is another way to do this, see "workspace.getViewManager().hideAppBar()" from the Integrating Web Author in a CMS or Another Application topic.
Would it suffice to use the "hideAppBar()" method?
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Re: Save button state refresh
Hello,
I think there is another issue because when I remove my javascript code to remove the "Builtin" toolbar and I let the framework part :
I get two "Save" buttons, the "builtin" one et the one added thanks to the framework but they do not have the same behaviour.
The "builtin" one becomes enabled after one character hit.
The one added with the framework becomes enabled after two character hits.
Regards,
Johann
I think there is another issue because when I remove my javascript code to remove the "Builtin" toolbar and I let the framework part :
Code: Select all
<field name="toolbarDescriptor">
<toolbar>
<field name="id">
<String>author_xml_switch_toolbar</String>
</field>
<field name="type">
<Integer>2</Integer>
</field>
<field name="toolbarEntriesDescriptorList">
<toolbarEntry-array>
<toolbarItem>
<field name="actionID">
<String>Author/ShowXML</String>
</field>
</toolbarItem>
</toolbarEntry-array>
</field>
</toolbar>
</field>
<field name="additionalToolbarsDescriptors">
<toolbar-array>
<toolbar>
<field name="id">
<String>author_core_actions_toolbar</String>
</field>
<field name="type">
<Integer>2</Integer>
</field>
<field name="toolbarEntriesDescriptorList">
<toolbarEntry-array>
<toolbarItem>
<field name="actionID">
<String>Author/Undo</String>
</field>
</toolbarItem>
<toolbarItem>
<field name="actionID">
<String>Author/Redo</String>
</field>
</toolbarItem>
<toolbarItem>
<field name="actionID">
<String>Author/Save</String>
</field>
</toolbarItem>
</toolbarEntry-array>
</field>
</toolbar>
</toolbar-array>
</field>
The "builtin" one becomes enabled after one character hit.
The one added with the framework becomes enabled after two character hits.
Regards,
Johann
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Save button state refresh
Post by Bogdan Dumitru »
Hello Johann,
You use the sync.api.Editor.EventTypes.ACTIONS_LOADED API in a very creative way and I guess that even the creator of the API didn't consider it. The API was designed to allow users to extend the toolbars by contributing actions or toolbars in "actionsConfig.toolbars", and wasn't designed with the need to remove the application's toolbar in mind.
Anyway, at a first glance, we don't see an instant solution to your problem.
Please help us to understand in-depth what you want to achieve so that can we guide you to a solution that overcomes the problem you encountered.
Please answer the following questions:
You use the sync.api.Editor.EventTypes.ACTIONS_LOADED API in a very creative way and I guess that even the creator of the API didn't consider it. The API was designed to allow users to extend the toolbars by contributing actions or toolbars in "actionsConfig.toolbars", and wasn't designed with the need to remove the application's toolbar in mind.
Anyway, at a first glance, we don't see an instant solution to your problem.
Please help us to understand in-depth what you want to achieve so that can we guide you to a solution that overcomes the problem you encountered.
Please answer the following questions:
- What is your use case (what do you want to achieve and also why)?
- Why do you want to remove actions from the application's bar?
- Why don't you remove the application's bar by using "workspace.getViewManager().hideAppBar()"?
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Save button state refresh
Post by Bogdan Dumitru »
Hi,
Indeed, there is a problem with the activation state if you put the Save action inside a custom toolbar.
To overcome it you have to manually refresh the action status when editor's dirty status changes:
Indeed, there is a problem with the activation state if you put the Save action inside a custom toolbar.
To overcome it you have to manually refresh the action status when editor's dirty status changes:
Code: Select all
editor.listen(sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED,
() => {
setTimeout(() => {
editor.getActionsManager().refreshActionsStatus("Author/Save");
})
});
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