I am creating a pluggable widget which has to show data based on the parent-child relationship of different entities. In order to do this, I figured that I would need to add the 'association' property type to my xml file as follows:
<property key="ref" type="association" selectableObjects="SelectableObjectsData">
<caption>Reference</caption>
<description>Reference</description>
<associationTypes>
<associationType name="Reference"/>
<associationType name="ReferenceSet"/>
</associationTypes>
</property>
This allows me to select an association, however, when I try to use this association in TypeScript, I am unable to do so because the association is 'undefined'. This also means that I am unable to retrieve a list of associated objects. The data that I specified in the datasource is loaded in correctly, and I am able to display that data in the widget
I have tried to configure the association in different ways, but I am unable to find out what I am doing wrong. There are a couple of questions I have in regards to what I have tried so far:
When selecting an association from the widgets properties, it seems as if I am only able to select objects, and not the actual associations themselves. Could this be the problem, or is this the way that selecting associations is supposed to work?
When configuring the association property, there is an option to specify a datasource, which in turn results in the property returning a ListReferenceValue instead of a ReferenceValue. The difference between specifying a datasource and not specifying a datasource (and the reasons why I would / wouldn't want to specify a datasource) remain unclear to me.
I have been struggling with this issue for a couple of days now. What I want to achieve here seems easy enough, but I can't really wrap my head around what I am doing wrong.