Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-330

CheckBox incorrectly converts its model value when a custom Boolean converter is installed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 branch (discontinued), 1.3.0-beta3
    • Fix Version/s: 1.3.0-rc1
    • Component/s: wicket
    • Labels:
      None

      Description

      When I use a custom localized Boolean converter (using my custom IConverterLocator) that converts "Ano" to true and "Ne" to false (Czech words for "yes" and "no") the CheckBox with 'true' getModelObject() will render unchecked. The problem is that CheckBox uses Strings.isTrue() to convert a value returned by getModelObjectAsString() which uses converters. The result is that true is incorrectly converted to false...

      true -> convertToString() -> "Ano" -> Strings.isTrue() -> false

        Attachments

        1. CheckBox.patch
          0.6 kB
          Martin Benda
        2. checkbox-getModelValue.patch
          0.6 kB
          Martin Benda

          Activity

            People

            • Assignee:
              jcompagner Johan Compagner
              Reporter:
              bendis Martin Benda
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: