Deleting An Attribute Value In A Combobox

<oXygen/> general issues.
john_m
Posts: 32

Deleting An Attribute Value In A Combobox

Wed Aug 23, 2017 10:26 pm

Hello,

I am using Oxygen XML Web Author and discovered an issue today.

I have several comboboxes in my document that edit attributes. These comboboxes pull their value from the schema and are initially set to blank. The issue I have is that if someone accidentally selects a value, I cannot delete the value - unless I go into the xml and delete it manually. We do not want our users to use the xml view - so this is not a good solution for my purposes.

I saw in the documentation for oxy_combobox that using canRemoveValue set to true creates an <Empty> value. However, that is not working for me...
I suspect because I am using values from the schema.

Below is the code - and in this example, I would like the ability to delete an accidentally filled-in value for the last combobox.

Any thoughts or suggestions?

Thanks!
John

Code: Select all

replacementNameplateRequired{
    content:
    oxy_label(text, "Replacment nameplate/modplates required: ", width, 18%)
    oxy_combobox(edit, "@replaceNameplate", editable, false, width, 10%)
    oxy_label(text, " ", width, 2%)
    oxy_label(text, "If Yes, replacement nameplate/modplate type: ", width, 18%)
    oxy_combobox(edit, "@nameplateType", editable, false, width, 52%);
}
Gabriel Titerlea
Posts: 33

Re: Deleting An Attribute Value In A Combobox

Thu Aug 24, 2017 3:31 pm

Hello,

You can use add an oxy_button when the attribute you want to remove is present. This button will remove the attribute.

Here's an example:

Code: Select all

replacementNameplateRequired[nameplateType]{ /* Adding the button only when the nameplateType attribute is present */
    content:
    oxy_label(text, "Replacment nameplate/modplates required: ", width, 18%)
    oxy_combobox(edit, "@replaceNameplate", editable, false, width, 10%)
    oxy_label(text, " ", width, 2%)
    oxy_label(text, "If Yes, replacement nameplate/modplate type: ", width, 18%)
    oxy_combobox(edit, "@nameplateType", editable, false, width, 52%)
   
    oxy_button(action, oxy_action(
      name, 'Remove nameplate',
      operation, 'ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation',
      arg-name, 'nameplateType' /* The attribute to remove */
    ));
   
}

I'm using the ChangeAttributeOperation in this example. You can find the documentation for this operation here [1].

Alternatively your users could use the Attributes panel to remove an attribute [2].

Best,
Gabriel

[1] https://www.oxygenxml.com/doc/versions/ ... eOperation
[2] https://www.oxygenxml.com/doc/versions/ ... _attribute

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest