Hi Mohan,
The pluggable widget API does not have documented support for data source attributes yet. The feature is in the making. Already some widgets in the Mendix repository are using it. The first variant will be read-only and can not be used to write. Nothing is officially released. And hope they will finish up and release this feature soon.
https://github.com/mendix/widgets-resources/blob/master/packages-web/maps/src/Maps.xml#L80
https://github.com/mendix/widgets-resources/blob/master/packages-web/maps/src/utils/data.ts#L20
https://github.com/mendix/widgets-resources/blob/master/packages-web/maps/src/utils/data.ts#L31
Cheers, Andries
mx.data.get({
guid: "123456",
callback: function(obj) {
console.log("Received MxObject with GUID " + obj.getGuid());
}
});
Andries Smit,
Documentation says we can retrieve data over association using widgets property type.
I followed the approach described in documentation and created Widget definition xml as below
<propertyGroup caption="Data source">
<property key="data" type="datasource" isList="true" required="false">
<caption>Data source</caption>
<description />
</property>
<property key="widgetContent" type="widgets" required="false" dataSource="data">
<caption>Content</caption>
<description>Widgets using data source</description>
</property>
</propertyGroup>
Code to process this data is as below
objItems.map(i => {
if(this.props.widgetContent!==null && this.props.widgetContent!==undefined){
let content:ReactNode = this.props.widgetContent(i);
console.log(content);
/* Retrieve child data over association from above 'content' variable */
}
});
I am passing only parent entity data to widget and as mentioned above I need to retrieve child data over association from widget input data.
Hi Mohan,
were you able to sort this out? I have the same challenge in one of my widgets currently.