Change custom action name depending on some event

Post here questions and problems related to oXygen frameworks/document types.
pramanikhimangshu
Posts: 17

Change custom action name depending on some event

Wed Feb 07, 2018 7:42 am

Hi,

I have a custom action dita framework to create a link and it modifies the link if selection is already link.
I want to change the display name of the action in context menu. In normal case it will display "Link..." and when the selection is already a link it should display "Modify Link..." in the context menu.

Any help how to do this..

Thanks.
Regards,
Himangshu
sorin_carbunaru
Site Admin
Posts: 157

Re: Change custom action name depending on some event

Wed Feb 07, 2018 12:12 pm

Hello Himangshu,

Unfortunately, changing the action's name based on the context is not possible. But I thought about a workaround that might interest you...

Instead of having one action that does 2 different things, you could have 2 separate actions, with their own names (let's say "Insert Link" and "Edit Link") and their own activation XPath expressions. The XPath expressions must be written in such a way that these 2 action will never be both active at the same time. And when one of them is not active, it won't even be rendered in the contextual menu. So, if you have both actions next to each other in the contextual menu, but only one of them is rendered at a given time, then for the user it will look like there is only one action that changes its name when the position in the document is changed.

Regards,
Sorin Carbunaru
oXygen XML

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests