yes please do. looks like we need a version of strings.true that also takes a localizer/converter
-igor On 2/5/07, Martin Benda <[EMAIL PROTECTED]> wrote:
Ok, thanks for clarifying the problem. Now I understand that what I tried to suggest won't work... But when I use a custom localized Boolean converter that converts "Ano" to true and "Ne" to false (Czech words for "yes" and "no") the CheckBox with "true" getModelObject() will render unchecked which is wrong too... true -> convertToString() -> "Ano" -> Strings.isTrue() -> false Should I create a new jira issue? Regards, Bendis On Monday 05 of February 2007 18:22:00 Igor Vaynberg wrote: > getValue() also works with raw input, not just the boolean model object > > imagine this > > you have a checkbox that starts out unchecked > > you check it > > submit the form > > a validator fails, so Boolean.TRUE never makes it into the checkbox model > > when the checkbox repaints, if it didnt do what it does now and use the > model as you suggest it would repaint _unchecked_ which is of course very > wrong. > > furthermore strings.true() doesnt need to be localized, no matter what > locale your browser is in submit values such as "on" are not localized. > > -igor > > On 2/5/07, Martin Benda <[EMAIL PROTECTED]> wrote: > > Hi, > > > > why is the boolean model value of a CheckBox converted to a String and > > again > > to a boolean (using Strings.isTrue) inside CheckBox#onComponentTag? > > > > boolean -> getValue() -> String -> Strings.isTrue() -> boolean > > > > Calling (getModelObject() == Boolean.TRUE) should be IMHO sufficient. > > > > Since Strings.isTrue(...) is hard-coded and cannot be localized, you will > > run > > into problems if you provide your own custom BooleanConverter which > > converts > > localized strings. > > > > WDYT? > > > > Regards, > > Bendis
