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

Doublebox shows a validation error when value is 0.001

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.7, 8.0.2
    • Fix Version/s: 8.0.3
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.0.3 S3

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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