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"?
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!