Entity Property within Object Property - Widget XML

1
Hi,    I'm working on a custom widget which uses an API which can allow users to send their own custom data via JSON. My idea for this was that I would use an Object property and allow developers to select attributes from a previously selected selected entity.  Something like this: <property key="cats" type="entity" isPath="no" required="true" allowNonPersistableEntities="false" > <caption>User Data Object</caption> <category>Data source</category> <description>Object to pull data</description> </property> <property key="collection" type="object" isList="true"> <caption>Collection</caption> <category>Appearance</category> <description>Add the properties to show in your collection</description> <properties> <property key="userDataAttribute" entityProperty="cats" type="attribute" entityProperty="userData"> <caption>attrubute of user</caption> <category>Data source</category> <description>attr to use</description> <attributeTypes> <attributeType name="String" /> </attributeTypes> </property> <property key="text" type="string"> <caption>attr name</caption> <category>Data source</category> <description>Key</description> </property> </properties> </property>   However this does not work,  So I've resorted to an approach like this:  <property key="collection" type="object" isList="true"> <caption>Collection</caption> <category>Appearance</category> <description>Add the properties to show in your collection</description> <properties> <property key="ent" type="entity" isPath="no" required="true" allowNonPersistableEntities="false" > <caption>User Data Object</caption> <category>Data source</category> <description>ent</description> </property> <property key="userDataAttribute" type="attribute" entityProperty="ent"> <caption>attrubute of user</caption> <category>Data source</category> <description>attr to use</description> <attributeTypes> <attributeType name="String" /> </attributeTypes> </property> <property key="text" type="string"> <caption>attr name</caption> <category>Data source</category> <description>Key</description> </property> </properties> </property>     My question is, is there an approach I've missed? 
asked
1 answers
2

Dear Simon,

What you like to do is possible with a small little trick use relative path "../"

<property key="userDataAttribute" entityProperty="../cats" type="attribute" >

See documentation "entityProperty"

https://docs.mendix.com/refguide/xml-reference-guide#4-2-attributes

Cheers Andries

answered