Skip to content

InputNumber: use by default a range of numbers for numeric type #13597

@bvfalcon

Description

@bvfalcon

Description

Now inputNumber by default (without defined maxValue/minValue attributes) allows input of numbers in diapason -10000000000000 .. 10000000000000. But in most cases this is incorrect:

  • for Long values this diapason is too short and does not allow big Long numbers
  • for Integer/Short/Byte values this diapason is too long and allow user to make an error by input non-convertable value.

Such default behaviour makes an easy passibility for beginner/lazy programmer to make an error, that will be obvious only in runtime, when website user want input an exceeding value. In this case website user have no such possibility (for Long values) or get a conversion error (for Integer/Short/Byte values).

Describe the solution you would like

Proposal is to make this default behaviour more safe: allow input only values, that could be converted without defining converter explicitly. Type of number value (and hence min/max values) in most cases can be determined on runtime (by value or by EL-expression).

Additional context

No response

Metadata

Metadata

Assignees

Labels

🐞 defectBug...Something isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions