StylesFilter issue when reopening document
Posted: Thu Jun 14, 2018 3:06 pm
Hi,
I am using oxygen SDK 19.1.0.3 and I have a problem with the StylesFilter class.
The goal is to add programmatically a combobox at a particular node. I want to do this programmatically because the labels and the values of this combobx are not fixed.
For this purpose, I added this kind of code in MyStylesFilter :
When I launch my application and open the document, I see the combobox perfectly.
But, if I close the document and re-open the same document, the combobox does not appear.
If I press F5, the combobox re-appears.
In the same way, if the combobox is not visible, if I collapse and expand the block in which the combobox is located, the combobox re-appears.
It's like the page didn't want to render...
Can you help me on this ?
Thanks,
Johann
I am using oxygen SDK 19.1.0.3 and I have a problem with the StylesFilter class.
The goal is to add programmatically a combobox at a particular node. I want to do this programmatically because the labels and the values of this combobx are not fixed.
For this purpose, I added this kind of code in MyStylesFilter :
Code: Select all
if (AuthorNode.NODE_TYPE_ELEMENT == authorNode.getType() && ("myElement".equals(authorNode.getName()))) {
Map<String, Object> formControlArgs = new HashMap<>();
formControlArgs.put(InplaceEditorArgumentKeys.PROPERTY_TYPE,
InplaceEditorArgumentKeys.TYPE_COMBOBOX);
formControlArgs.put(InplaceEditorArgumentKeys.PROPERTY_EDIT_QUALIFIED, "@myAttribute");
formControlArgs.put(InplaceEditorArgumentKeys.PROPERTY_VALUES, "value1,vale2,value3");
formControlArgs.put(InplaceEditorArgumentKeys.PROPERTY_LABELS, "label1,label2,label3");
formControlArgs.put(InplaceEditorArgumentKeys.PROPERTY_EDITABLE, "false");
StaticContent[] mixedContent = new StaticContent[]{new EditorContent(formControlArgs)};
styles.setProperty(Styles.KEY_MIXED_CONTENT, mixedContent);
return styles;
}
But, if I close the document and re-open the same document, the combobox does not appear.
If I press F5, the combobox re-appears.
In the same way, if the combobox is not visible, if I collapse and expand the block in which the combobox is located, the combobox re-appears.
It's like the page didn't want to render...
Can you help me on this ?
Thanks,
Johann