ask editor variable with ChangeAttributesOperation

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Johann
Posts: 164
Joined: Wed Jun 17, 2015 12:46 pm

ask editor variable with ChangeAttributesOperation

Post by Johann »

Hello,

I am using the Author web 25 version.

I have created this operation:

Code: Select all

<a:operation id="ChangeAttributesOperation">
    <a:arguments>
        <a:argument name="attributeNames">attr1
            attr2</a:argument>
        <a:argument name="values">${ask('Change attr1:', generic)}
             ${ask('Change attr2:', generic)}
        </a:argument>
         <a:argument name="removeIfEmpty">true</a:argument>
    </a:arguments>
</a:operation>

When I launch this action, a popup is displayed allowing to change attr1 and attr2 with two fields.
The problem is that I would like to have the possibility to put a non empty value to only one of this attribute filed and let the other one at an empty value.
If an attribute has an empty value in the popup field, it has to be removed from the XML.
I cannot perform this because the form forces to have two non empty values.

Do you have an idea to perform this behaviour?

Thank you for your help,

Johann
mihaela
Posts: 394
Joined: Wed May 20, 2009 2:40 pm

Re: ask editor variable with ChangeAttributesOperation

Post by mihaela »

Hello,

We tested the operation you provided and we managed to reproduce the problem, thank you for the details.
The empty value should be allowed for the asks inputs in the dialog.
We added an issue in our internal issues tracking system and we will update this thread when the fix will be available.

Best Regards,
Mihaela.
Mihaela Calotescu
http://www.oxygenxml.com
Johann
Posts: 164
Joined: Wed Jun 17, 2015 12:46 pm

Re: ask editor variable with ChangeAttributesOperation

Post by Johann »

Hello Mihaela,

Can we expect to have the fix before March 2023?

Best regards,

Johann
Bogdan Dumitru
Site Admin
Posts: 71
Joined: Tue Mar 20, 2018 5:28 pm

Re: ask editor variable with ChangeAttributesOperation

Post by Bogdan Dumitru »

Hello Johann,

Note that you can easily implement your own dialog that allows invoking the operation with an empty value:
  1. create a custom AbstractAction and register it to the ActionsManager, as this tutorial shows
  2. retrieve user input by showing a Dialog with the two input fields within your action's "actionPerformed()" method. See in this tutorial how to show a dialog
  3. invoke ChangeAttributesOperation when the OK dialog button is pressed (see Dialog.onSelect()) using ActionsManager.invokeOperation()
We haven't scheduled a fix for this limitation of the ask-variables support and considering this, we advise you to implement the dialog to avoid the issue.
Bogdan Dumitru
http://www.oxygenxml.com
Post Reply