attributes are editable for readonly elements

Oxygen general issues.
DirkGGT
Posts: 2
Joined: Fri Mar 15, 2024 1:52 pm

attributes are editable for readonly elements

Post by DirkGGT »

Using an AuthorNodeCssCustomizer, I have made certain elements of a DITA file readonly by setting

Code: Select all

styles.setProperty(Styles.KEY_EDITABLE, Boolean.valueOf(editable));
This works pretty good: editing the element's content is not possible, and everything in the attributes view is grayed out. When I doubleclick the element, the "Generate Unique ID Value" button in the in-place attributes editor is also grayed out. BUT: it is still possible to manually enter a new value in the input field next to it. Is there a reason for this inconsistency, or is this a bug?
Following this suggestion by Radu, I implemented a CustomAttributeValueEditor, but this does not help either, because it only takes effect after clicking the "Generate Unique ID Value" button, which is grayed out anyway on readonly elements.
As a workaround, I'm testing with an AuthorAttributesDisplayFilter to filter unwanted attributes. That's okay for me, but I still think that attributes of readonly elements should not be editable in the in-place attributes editor.

Greetings,
Dirk
CharlotteMurphy
Posts: 1
Joined: Tue Feb 18, 2025 10:18 am
Location: https://driftboss2.org
Contact:

Re: attributes are editable for readonly elements

Post by CharlotteMurphy »

Implementing an AuthorAttributesDisplayFilter can hide specific attributes from the Attributes view, effectively preventing their modification. This approach, however, removes the attribute from view entirely, which may not be ideal if you want the attribute to be visible but uneditable.
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: attributes are editable for readonly elements

Post by Radu »

Hi,

One would probably need to have a content completion configuration XML file to state that values for certain attribute are not editable:

https://www.oxygenxml.com/doc/versions/ ... osals.html

I think it's something like this:

Code: Select all

 <valueProposals path="element/@value" editable="false"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply