Limit the values that can be entered into SearchField

0
Hi All, I'm wondering how to limit the values that can be entered into SearchField. Because I got the error When I enter a character exceeding the digit of Long. It is caused by: java.lang.NumberFormatException: For input string: I understand the reason.  I think that if you can limit digits, I will not get errors. Thank you in advance!!
asked
2 answers
1

Hi Toshiya,

I'd recommend filing a ticket for this: there should at least be a proper message telling the user that the input is too long, instead of a numberformatexception error message.

on topic: perhaps you can achieve this with CSS, maxlength="X"?

answered
1

Hi Toshiya,

I did some more research, as you cannot use maxlength property using standard sass and css:

You can use the setAttribute widget to achieve this: https://appstore.home.mendix.com/link/app/5958/

put the widget below the search fields, give the grid a custom class (I named mine "cakerules") and enter a new attribute in the widget as such:

 

This way you can set a max input length for all search fields!

answered