Pluggable Widget - Call Microflow with Parameter

0
I am trying to use the new Pluggable Widget API. I can render an object passing parameters from the containing MxObject, and would now like to set up clickable sections that pass different string parameters into a single microflow. Using dojo widgets this seemed to be possible by using Mendix objects containing string attributes, and the client API, but I can’t find a way to do it using the Pluggable Widgets API. The only solution I can seem to get to work is by defining multiple actions in the widget XML, creating separate microflows and setting them in the configuration. Then using executeAction. This is obviously sub-optimal. The examples available in the app store all use hybrid widgets and the Client API which doesn’t seem to be avaialble to Mendix widgets.   Does anyone know if this is possible? Or if it is on the roadmap for Mendix to develop?
asked
1 answers
2

Hi Joe,

A microflow can never receive a primitive string from a widgets (not for dojo not form pluggable widget), only microflows calling microflows from an other (sub)microflow or nanoflow (since 8.8) can pass a string.

In widgets, you can provide a context objects (including the parent) to the microflow. You should store your string data in one of it attributes.

In your case you could create an attribute property https://docs.mendix.com/apidocs-mxsdk/apidocs/property-types-pluggable-widgets#attribute And set it on click with a string (or enum) value of you section, and process all your request with a single microflow.

Cheers, Andries 

answered