Obtain attributes max length in widget

2
I am in need of a text input box which executes a microflow when a value is changed, immediately (instead of when focus is lost, which is default). For this I found OnChangeInputbox in the app store which works well. It needs some tweaks to make it work in our project, one of which is that it does not render maxlength on the input html element, like the standard mendix text input box does. So I am looking for a way to pass the max length of a limited length string to the widget. I can't find a way to access it using the Mendix client api, or am I overlooking something? Or is there a way to implicitly send it as a property maybe? I could make a property which has to be set to the max length manually, but this is not preferred.
asked
1 answers
2

It seems this value is not accessible, neither on the client, nor on the server. Mendix hard codes this into the pages of the application: if you deploy your application and take a look at /deployment/web/pages/LANGUAGE/MODULE/PageName.xml, you will see something like:

 

<div data-mendix-id='27_6' class='form-group mx-name-textBox6'>
    <label class='control-label col-sm-4'>Naam</label>
    <div data-mendix-id='27_17' data-mendix-type='mxui.widget.TextInput' data-mendix-props='"insideFormGroup":true,"attributePath":"Beheer.Contactgegeven/Naam","placeholder":"","maxLength":200' class='col-sm-8' tabindex='0'>
    </div>
</div>

I'm afraid you will have to come up with a workaround. The easiest one would be to hardcode the max length to 200 (which is the default setting in Mendix).

Furthermore, this seems like a perfectly valid use case, so you should also submit having access to this data as an idea on this forum.

answered