On Thu, 2004-07-01 at 09:32, Colin Paul Adams wrote: > Binding of an xs:boolean attribute in an XML file to a form with an > fd:booleanfield does not work as I would expect it to. > > For an attribute a of type xs:boolean, I would expect: > > a="true" or a="1" to set the checkbox. > a="false" or a="0" or the absence of an a attribute to unset the > checkbox. > Anything else to signal a validation error. > > I find that setting the a attribute to ANYTHING AT ALL (even the empty > string!) sets the checkbox, and only the absence of the attribute > unsets it. > > Is this the proper behaviour?
Are you using a convertor in the binding? Should be I suppose, otherwise you'd get a classcastexception. The PlainBooleanConvertor (the only convertor there is for booleans) uses java's Boolean.valueOf which only returns true if the string value equals, ignoring case, "true". -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
