label-widget: add a property to link it to an form-element - Mendix Forum

label-widget: add a property to link it to an form-element

3

Sometimes you need to add a label to a form-element that cannot have it's own label. For instance with the ClockPicker for Mendix

and I have run into this before, there are more use cases.

You can add the label-widget, but it does only partly create a label. What is missing is the option to assign the label-widget to a form element that it has to follow.

asked
1 answers

Hi Tim, 

Convert you widget to a pluggable widget. and you can get your label for “free”. see docs

https://docs.mendix.com/apidocs-mxsdk/apidocs/property-types-pluggable-widgets#label

Your suggestion by it self, is probably hard create, as the label should be for a specify the the for=id, this should be the input element, which by it self does not need to be the first one or only one. In that case you should set in the widget the aria-labeledby inside the widget itself.

Cheers, Andries

Created