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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0 branch (discontinued), 1.3.0-beta3
    • 1.3.0-rc1
    • wicket
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: