Pluggable widgets -> Access associated data of an entity using client API

Hi, I have developed a pluggable widget with property type as ‘datasource’. Widget is  accepts entity object as input and using this input object I want to access the associated data through association and its attributes inside the widget using client API.  ObjectItem that represents input object gives only ID. Any suggestions on retrieving input object’s associated data inside the widget? Below is the sample Widget definition XML <property key="data" type="datasource" isList="true" required="false"> <caption>Data source</caption> <description /> </property> I tried using it with widget type property. But I am not sure how to retrieve data over association
3 answers

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.

Cheers, Andries


    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 key="widgetContent" type="widgets" required="false" dataSource="data">
                <description>Widgets using data source</description>

Code to process this data is as below => {
                    if(this.props.widgetContent!==null && this.props.widgetContent!==undefined){
                        let content:ReactNode  = this.props.widgetContent(i);
                        /* 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.