Mendix special check empty returns false for empty strings

0
If you clear an input field and then proceed to save and call the microflow that checks if this value is empty. When you debug and inspect the model. The value in the field (for example if it is a text input) will be ‘’ (single quote single quote). This is an empty string but it is evaluated by the special check empty as not empty. Observed in mendix studio pro 8.17 – this version is not yet available in the drop down Currently I am relying on checking that value for the ‘’ to get around this. What is the difference and what does special check empty consider empty? What would be the best way to check if an input has no value, in other words it is completely empty user hasn’t entered anything.  Validation is custom and is not against the persisted entity, I am using a ViewModel (UIModel) entity that is not persistable.
asked
1 answers
1

empty is the equivalent of null in Java, there is no value at all. ‘’ is a String of zero length.
 

When I validate a String has content, I always check for not empty and that a trimmed version of the string does not equal ‘’.

You can also use IsEmtpyString and IsNotEmptyString in the Community Commons module to do a similar thing.

Hope this helps.

answered