How do I set one entity and a list of attributes for that entity in a widget properties file ?

5
I am creating a widget where I would like to select an entity and a list of that entity's attributes. I have: <properties> <property key='myEntity' type='entity'> <caption>Entity</caption> <category>Data Source</category> <description>Entity to use.</description> </property> <property key="entityAttributes" type="object" required="false" isList="true"> <caption>Attributes</caption> <category>Data Source</category> <description>fdas</description> <properties> <property key="attributes" type="attribute" entityProperty="myEntity"> <caption>Attribute</caption> <category>Data Source</category> <description>Attribute to use.</description> <attributeTypes> <attributeType name="String"/> <attributeType name="Boolean"/> <attributeType name="Enum"/> </attributeTypes> </property> </properties> </property> </properties> This gives me an error in Mendix, "'entityAttributes.attributes': entity property does not resolve.". (1) Am I correct in assuming an entity referenced must be a sibling node in the XML to work ? Subsequently I try to not specify an entityProperty at all, but then needsEntityContext needs to be true, which causes the widget to not be standalone as it then requires a data view. One solution I have came up with is to move 'myEntity' property to my 'entityAttributes' property, as a sub-property, then I can reference it with entityProperty, but this is undesirable as you can then select different entities/attributes. I've looked at widget.xsd and some examples and can not figure this out, thanks in advance.
asked
1 answers
4

The list of attributes is considered a level deeper, and it will therefor try to search the 'mEntity' on that level.

It should work using '../mEntity'.

answered