Issue Updating Attribute in Oxygen UI Interface
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 48
- Joined: Thu Feb 16, 2023 11:00 pm
Issue Updating Attribute in Oxygen UI Interface
Good morning,
We have created a class that extends WebappFormControlRenderer to update the content of an element called <externalPubCode>. The update of the internal text content worked perfectly, and the system responded as expected.
However, we encountered an issue when trying to update the "pubCodingScheme" attribute. Although the attribute was successfully modified in the XML document via the Java API, the change was not reflected in the Oxygen UI interface — the attribute remained unchanged from the user's perspective.
We attempted to refresh the node, but it did not work. We tried two different coding approaches, both of which correctly updated the XML document, but neither managed to update the UI interface.
Below is a summary of the two approaches we used:
The main class that call the other:
Could you please advise us on the correct way to update this attribute so that the change is properly reflected in the UI?
Thank you in advance for your support.
Best regards,
Audye Scola Junior
We have created a class that extends WebappFormControlRenderer to update the content of an element called <externalPubCode>. The update of the internal text content worked perfectly, and the system responded as expected.
However, we encountered an issue when trying to update the "pubCodingScheme" attribute. Although the attribute was successfully modified in the XML document via the Java API, the change was not reflected in the Oxygen UI interface — the attribute remained unchanged from the user's perspective.
We attempted to refresh the node, but it did not work. We tried two different coding approaches, both of which correctly updated the XML document, but neither managed to update the UI interface.
Below is a summary of the two approaches we used:
Code: Select all
public static void setElementAttributeV1(AuthorAccess authorAccess, AuthorElement element, String attribute, String value) {
AuthorDocumentController docControl = authorAccess.getDocumentController();
ArgsMap args = new ArgsMap();
try {
args.put("elementLocation", docControl.getXPathExpression(element.getStartOffset() + 1));
args.put("name", attribute);
args.put("value", value);
new ChangeAttributeOperation().doOperation(authorAccess, args);
logger.error("setElementAttributeV1 OK");
} catch (BadLocationException | AuthorOperationException e) {
logger.error("Error on setElementAttribute.", e);
}
}
public static void setElementAttributeV2(AuthorAccess authorAccess, AuthorElement element, String attribute, String value) {
AuthorDocumentController docControl = authorAccess.getDocumentController();
docControl.setAttribute(attribute, new AttrValue(value), element);
authorAccess.getEditorAccess().refresh(element);
logger.error("setElementAttributeV2 OK");
}
Code: Select all
public class ReferenceRenderer extends WebappFormControlRenderer
Thank you in advance for your support.
Best regards,
Audye Scola Junior
image.png
image.png
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service