Hello all I’m building a pluggable widget and want to load data based on a xpath which will be supplied from user input. When I define a datasource in my xml definition file, i can’t use a constraint or xpath dynamically. I have to set it in the widget configuration in mendix. But i want this to be variable. Can I send a async data request from my widget code (Frontend) based on a user input change and then transform and display my recieved data in my widget? I found the following api documentation: https://apidocs.rnd.mendix.com/9/client/index.html But it seems like this is for Mendix 8 and Dojo Widgets. Can I still use this or is there a new way of loading data dynamically in widgets?
You can use the Client API as well within a Pluggable widget. I believe my ArcGIS widget, based on the Pluggable Widgets API, see Marketplace, does this as well.
I would like to challenge you on using the datasource from the Pluggable Widgets API though as that is the way to go for now. Can’t you solve this dynamic part with a flexible domain model set up?
Other option; build the XPath yourself and then feed it to a Java action to get the correct List of Objects. Feed that list of objects via a datasource construction to the new widget.