dynamic action name

Posts: 2
Joined: Thu Sep 24, 2020 8:20 pm

dynamic action name

Post by fjeneau » Tue Sep 29, 2020 6:51 pm

Is there any way to use editor variables like ${xpath_eval()} for the name of an action defined in a framework or to dynamically generate the action name used for oxy_button? We have a use-case where CSS is defining an oxy_button(...) and the hover text needs to be unique based on attributes of the element it is in. This is for Web Author, but it would be good to know if the functionality exists in the desktop version as well.

The action itself is JS, but the oxy_button is clearly pulling the name from the 'name' field in the framework file instead of getDisplayName. I know there is a way to define the action and the name in the CSS itself using oxy_action. In our case though, the java would be an AuthorOperationWithResult and would still need to continue in JS, so I don't think we can use oxy_action.

Posts: 270
Joined: Thu Sep 04, 2014 4:22 pm

Re: dynamic action name

Post by cristi_talau » Tue Sep 29, 2020 9:25 pm


The builtin button does not offer this degree of flexibility. However you can implement a custom form control that behaves like a button, but has a dynamic name. Here is a tutorial [1] and we also have an example which renders MathML equations on GitHub [2].


[1] https://www.oxygenxml.com/maven/com/oxy ... ntrol.html
[2] https://github.com/oxygenxml/web-author-mathml-plugin

Post Reply