Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3218

Doublebox shows a validation error when value is 0.001

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.3
    • 7.0.7, 8.0.2
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.0.3 S3

      From a user's perspective, the value is 0.001 instead of 0.

      steps to reproduce

      1. load the attached zul
      2. click the button

      actual result

      the message "error number is not allowed" shows

      expected result

      no error message shows.

      workaround

      Specify format with more precise pattern.

      <doublebox id="db" constraint="no zero" format="#.###" />
      

      root cause

      getValue() calls checkUserError(), and it validates the value by coerceToString(value) according to default format #.#. So the value it gets is 0.0 which violates the constraint.

      It's better to validate the real value without converting to a string first.

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h