cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/datatype/convertor PlainBooleanConvertor.java
Date Tue, 02 Dec 2003 22:04:31 GMT
Bruno Dumon wrote:

>On Tue, 2003-12-02 at 18:02, Vadim Gritsenko wrote:
>  
>
>>Bruno Dumon wrote:
>>
..

>>>My intuition tells me that a BooleanConvertor should return a Boolean
>>>object.
>>>
>>>What's the purpose of this, IOW what is affected by this? 
>>>
>>>      
>>>
>>Commit log says it all: instead of null, JavaBean gets Boolean.FALSE, 
>>which is, as I believe, wrong: you should not bind FALSE instead of null.
>>    
>>
>
>Still trying to understand how you're using it in order to fully
>understand the problem:
>Where exactly are you using the convertor? In the binding definition? If
>the Javabean holds a Boolean property, why do you need the convertor
>there?
>  
>

Ok, step by step. Here is model:
    <wd:field id="hasSomething">
      <wd:datatype base="boolean">
        <wd:convertor type="plain"/>
      </wd:datatype>
      <wd:selection-list>
        <wd:item value="true">
          <wd:label>Yes</wd:label>
        </wd:item>
        <wd:item value="false">
          <wd:label>No</wd:label>
        </wd:item>
        <wd:item value="">
          <wd:label>Dunno</wd:label>
        </wd:item>
      </wd:selection-list>
    </wd:field>

Template:
  <wt:widget id="hasSomething">
    <wi:styling list-type="radio" list-orientation="horizontal"/>
  </wt:widget>

Binding:
    <wb:value id="hasSomething" path="something"/>

Bean:
    void setSomething(Boolean);
    Boolean getSomething();


It did not work before the patch; convertor was returning Boolean.FALSE 
when, in fact, the value was NULL.

Vadim



Mime
View raw message