Hi Tobias,
I'm not too experienced with pluggable widgets yet, but I do know that mxform is a property of Custom widgets (i.e. the dojo ones), as mentioned in the api docs.. The this.mxform you found in other posts is probably referenced from that context.
I can't immediately find a substitute for that property in the pluggable widgets documentation, but you could try checking whether it might be passed as a prop to the widget (something like this.props.mxform I guess?)
Good luck!
Jeroen
Okay, I managed to find a solution.
It’s a pretty ugly workaround but it does it’s job and I couldn’t find any other solution.
Basically what I did is change the microflow to return a string, in my case it’s just the value “close page”. I additionally added a button outside the widget on the popup, hid it with css (display: none) and gave it a class to find it in the dom from within the widget (.btn-close),
In the widget I process the response and check if it matches “close button”, if it does I simply simulate a click on that button:
callback: function (obj) {
if (obj === 'close page') {
const closeButtons = document.getElementsByClassName('btn-close');
if (closeButtons.length > 0) {
closeButtons[0].click();
}
}
}
I hope this helps someone
- Tobias