You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Benda (JIRA)" <ji...@apache.org> on 2007/10/04 10:02:50 UTC

[jira] Reopened: (WICKET-330) CheckBox incorrectly converts its model value when a custom Boolean converter is installed

     [ https://issues.apache.org/jira/browse/WICKET-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Benda reopened WICKET-330:
---------------------------------


> So as far as i can see setting a converter on a Checkbox is weird. The converter really only works for text input fields.
Yes, but I want to use the converter for TextFields and not for CheckBoxes! The problem is that there is a side-effect of the new converter: all CheckBoxes become broken.

Now the CheckBox relies on the default implementation of the Boolean converter (via the getModelObjectAsString method). What I propose is to get rid of this dependency and make CheckBoxes work independently of Boolean converters. 

> CheckBox incorrectly converts its model value when a custom Boolean converter is installed
> ------------------------------------------------------------------------------------------
>
>                 Key: WICKET-330
>                 URL: https://issues.apache.org/jira/browse/WICKET-330
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>            Reporter: Martin Benda
>            Assignee: Johan Compagner
>             Fix For: 1.3.0-beta4
>
>         Attachments: checkbox-getModelValue.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.