Conditional Property Types within Custom Widget Definitions

1
Hi,   I noticed in the new Combo box widget Mendix are somehow using conditional visibility on the input types depending on what you select, it will show different results.   I have looked through the mendix documentation and cannot see how they have done this. https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/   Notice how the clearable hides when switched from Enumeration -> Boolean.     Additionally I converted the combox into a zip, looked at their source definition xml file and can not see anything here either.     Anyone know how its done? I feel like I'm missing something simple   Thanks Adam
asked
1 answers
1

Hi Adam,

to conditionally show/hide properties, you need to define a getProperties function inside the editorConfig file.

You can find docs here: 

https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-config-api/#3-customizing-the-widgets-properties

And here how it's used for the Combo box:

web-widgets/packages/pluggableWidgets/combobox-web/src/Combobox.editorConfig.ts at main · mendix/web-widgets · GitHub

 

Hope this helps!

answered