MyFaces Extensions Validator
  1. MyFaces Extensions Validator
  2. EXTVAL-124

The message for 'source' target is not correct in the case of DateIsType.same

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.4, 2.0.4
    • Fix Version/s: 2.0.5, 1.2.5
    • Component/s: Property Validation
    • Labels:
      None

      Description

      Using a validation annotation like this:

      @DateIs(type = DateIsType.same, valueOf = "endDate", validationErrorMsgTarget = MessageTarget.source)

      results in an error message that contains the text 'before'
      Date has to be before

      {0}

        Activity

        Hide
        Rudy De Busscher added a comment -

        A workaround is possible by using the 'validationErrorMsgKey' attribute to specify the error text to use.

        @DateIs(type = DateIsType.same, valueOf = "endDate", validationErrorMsgTarget = MessageTarget.source, validationErrorMsgKey = 'Date has to be equally to

        {0}

        ')

        Show
        Rudy De Busscher added a comment - A workaround is possible by using the 'validationErrorMsgKey' attribute to specify the error text to use. @DateIs(type = DateIsType.same, valueOf = "endDate", validationErrorMsgTarget = MessageTarget.source, validationErrorMsgKey = 'Date has to be equally to {0} ')
        Hide
        Rudy De Busscher added a comment -

        For the source component, the

        {0}

        is the label of the source field itself (which isn't very helpful). Should behave the same as in the case of the MessageTarget.target where we see the other date value that is used to compare with.

        Show
        Rudy De Busscher added a comment - For the source component, the {0} is the label of the source field itself (which isn't very helpful). Should behave the same as in the case of the MessageTarget.target where we see the other date value that is used to compare with.

          People

          • Assignee:
            Rudy De Busscher
            Reporter:
            Rudy De Busscher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development