Page 1 of 1
make action disable in read only mode
Posted: Wed Apr 12, 2023 8:26 am
by shikhar_472
Hi Team,
I want to disable the action button in read only mode and enable the actions when read only mode is false in web author.
i have tried passing isenabled(){return false} which is making the button disable now i want to enable this without reloading the web author.
Could you please help me with that.
Re: make action disable in read only mode
Posted: Wed Apr 12, 2023 1:46 pm
by shikhar_472
Hi Team,
I have one more query on undo operation phesudo classes are not getting back is there any way to resolve this.
Re: make action disable in read only mode
Posted: Wed Apr 12, 2023 2:11 pm
by Bogdan Dumitru
Hello,
To make a Web Author action (sync.api.AbstractAction) disabled or enabled depending on the read-only state of the editor (or of the document) you have to implement the isEnabled() method and return true and false depending on the read-only state. Somewhat like this:
"return this.editor_.getReadOnlyState().readOnly".
See also
this forum post and the
sync.api.ActionsManager.html#refreshActionsStatus API.
Re: make action disable in read only mode
Posted: Wed Apr 12, 2023 2:14 pm
by Bogdan Dumitru
Regarding "one more query", please provide more information. What are you trying to solve exactly?
By the way, I think it would be great to post on a dedicated thread on the Oxygen Forum because that way you have higher chances to be helped by other people too, not just from the people interested in "make action disable in read only mode" thread.
Re: make action disable in read only mode
Posted: Thu Apr 13, 2023 8:22 am
by shikhar_472
Hi Thanks for the reply,
Now user's want's some of actions should not be visible itself in read only mode they want icons to be non visible and when read only mode false that time icons should be visible as they want to use use only few operations in read only mode so they dont want to see others in disable mode they want them to be hidden.
Re: make action disable in read only mode
Posted: Thu Apr 13, 2023 11:56 am
by Bogdan Dumitru
Hi,
Does the
How to Remove a Toolbar Button topic from the Oxygen XML Web Author JavaScript API manual helps?
Re: make action disable in read only mode
Posted: Thu Apr 13, 2023 12:44 pm
by shikhar_472
yes but the moment read only mode is false i want all the buttons to be enable without loading the editor.
Using unregister action we can remove the button but the moment readonlymode set to false i want them back without loading the editor
Re: make action disable in read only mode
Posted: Mon Apr 17, 2023 7:08 am
by shikhar_472
Hi Team,
Is there any update?
Thanks
Re: make action disable in read only mode
Posted: Tue Apr 18, 2023 2:49 pm
by mihaela
Hello,
There is no API available to add or remove buttons in the toolbar without reloading the editor.
It is possible only to update the enabled status of the action, as you already found.
Best Regards,
Mihaela
Re: make action disable in read only mode
Posted: Thu Apr 20, 2023 9:55 am
by shikhar_472
Hi,
I wanted to enable and disable the icon same way in right pane, the way i am doing in toolbar using isEnabled method but in right pane i am using view rendror is that possible to enable disable according to readonly mode in right pane
Re: make action disable in read only mode
Posted: Fri Apr 21, 2023 11:18 am
by mihaela
Hello,
Please answer the following questions to help us better understand your use case and provide a solution:
- Do you want to enable/disable the view icon or the icons of the actions included in the view?
- The read-only state of the editor changes dynamically, during the editing? Who changes this state? Do you use a customization for this, or a built-in plugin?
Best Regards,
Mihaela