Activation Xpath for a custom javascript framework action

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Activation Xpath for a custom javascript framework action

Post by NicoAMP »

Hello,
When I create a custom framework action via the UI, I can setup an "activation Xpath" that permit to control when my action is available.
When I create a custom framework action with javascript I can use following function :

Code: Select all

MyAction.prototype.isEnabled = function () {
   return !this.editor.getReadOnlyState().readOnly;
};
But it seems that it's not possible to use an "activation Xpath" here.
So the question is : is it possible to setup an "activation Xpath" for a custom javascript framework action?

Thanks.
Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
mihaela
Posts: 488
Joined: Wed May 20, 2009 2:40 pm

Re: Activation Xpath for a custom javascript framework action

Post by mihaela »

Hello,

You can read more details about the actions "activation XPath" in the Migrating a Framework from Oxygen XML Editor/Author to Web Author topic from our Oxygen XML Web Author Customization Guide.

If the configured activation XPath evaluates to false at the current cursor position, it does not disable the actions on the Web Author toolbar, but when the user tries to invoke an action, the operation will not be executed (if the XPath evaluates to false) and the user will be notified that the action is not available at that location.



Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Activation Xpath for a custom javascript framework action

Post by NicoAMP »

Hello Mihaela,

Thanks for this information.
But my question was more : how can I define an activation xpath with javascript code ?

Thanks.
Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
mihaela
Posts: 488
Joined: Wed May 20, 2009 2:40 pm

Re: Activation Xpath for a custom javascript framework action

Post by mihaela »

Hello,

Sorry for not answering to your question exactly. You cannot define an activation XPath with javascript code. Some details about your use case can help us identify if there is another way to use the javascript API to accomplish what you need.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply