[Yanel-dev] Re: [Yanel-commits] rev 45177 - public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/jelly/tags

Michael Wechner michael.wechner at wyona.com
Mon Nov 2 15:19:50 CET 2009


Guillaume Déflache wrote:
> Hi!
>
> michi at wyona.com schrieb:
>> Author: michi
>> Date: 2009-10-25 00:34:45 +0200 (Sun, 25 Oct 2009)
>> New Revision: 45177
>>
>> Modified:
>>    
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/jelly/tags/CheckboxTag.java 
>>
>> Log:
>> checked attribute fixed
>>
>> Modified: 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/jelly/tags/CheckboxTag.java 
>>
>> ===================================================================
>> --- 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/jelly/tags/CheckboxTag.java    
>> 2009-10-24 22:33:38 UTC (rev 45176)
>> +++ 
>> public/yanel/contributions/resources/creatable-modifiable-deletable-v3/src/java/org/wyona/yanel/impl/jelly/tags/CheckboxTag.java    
>> 2009-10-24 22:34:45 UTC (rev 45177)
>> @@ -31,6 +31,12 @@
>>                  attributes.addAttribute(XHTML_NAMESPACE, "", "type", 
>> "CDATA", "checkbox");
>>                  attributes.addAttribute(XHTML_NAMESPACE, "", "name", 
>> "CDATA", item.getName());
>>                  attributes.addAttribute(XHTML_NAMESPACE, "", 
>> "value", "CDATA", selection[i].getValue());
>> +                if (selection[i].getValue().equals("true")) {
>> +                    log.debug("Checked!");
>> +                    attributes.addAttribute(XHTML_NAMESPACE, "", 
>> "checked", "CDATA", "true");
>> +                } else {
>> +                    log.debug("NOT Checked!");
>> +                }
>>                                   if (isSelected(selection[i])) {
>>                      attributes.addAttribute(XHTML_NAMESPACE, "", 
>> "checked", "CDATA", "checked");
>>
>
> This does not seem to work because in some cases the "checked" 
> attribute is added two times (see exception at the bottom of the 
> message).
in which cases? And how can I reproduce your exception?
>
> What was the purpose of this change? Did it fix some bug?

yes, one couldn't set a checkbox to checked from the very beginning 
(checkboxes are not checked by default and couldn't be set to checked 
upon creation
or rather if set to true upon creation, the checked attribute was not set).
>
> Also using "true" as a value for the "checked" attribute seems wrong 
> (this is not valid XHTML), why wasn't "checked" used?

my bad, I have changed it now.

Thanks

Michael
>
> Cheers,
>   Guillaume




More information about the Yanel-development mailing list