Create a single javascript action and collect the element that called it programmatically
Posted: Mon Nov 13, 2023 5:56 pm
Good morning guys!
We are creating some Actions via Javascript that collect information from a WebService and insert a fragment into the XML that is being edited.
We created the Action in framework and linked it to the Content Completion Item configuration.
We realized that we are creating several Actions that are almost identical because we are linking each element to a specific action.
Is there a way to retrieve which element called the Action via Javascript?
With this we can create an action factory and create specific classes per element.
Our idea is to create an "Insert CIR REF" action and connect each element to this single action and the action collects the element that called it and calls its respective action.
Another question... Is there any way to send a parameter via URL and collect this parameter via Javascript or Java?
Example:
//localhost:8008/oxygenxml-web-author/app/oxygen.html?url=webdav-http%3A%2F%2Fwebdav-dev-host.pub.com.br%2FName%2520Procedure%2520Data%2520Module.xml&project=OUR_PROJECT
We want to collect this project information.
We are creating some Actions via Javascript that collect information from a WebService and insert a fragment into the XML that is being edited.
We created the Action in framework and linked it to the Content Completion Item configuration.
We realized that we are creating several Actions that are almost identical because we are linking each element to a specific action.
Is there a way to retrieve which element called the Action via Javascript?
With this we can create an action factory and create specific classes per element.
Our idea is to create an "Insert CIR REF" action and connect each element to this single action and the action collects the element that called it and calls its respective action.
Another question... Is there any way to send a parameter via URL and collect this parameter via Javascript or Java?
Example:
//localhost:8008/oxygenxml-web-author/app/oxygen.html?url=webdav-http%3A%2F%2Fwebdav-dev-host.pub.com.br%2FName%2520Procedure%2520Data%2520Module.xml&project=OUR_PROJECT
We want to collect this project information.