> -----Original Message-----
> From: Franco Caponi [mailto:franco.caponi@;tin.it]
> Sent: Tuesday, October 22, 2002 12:12 PM
> 
> There is a suspicious bug on the CheckboxTag. Infact i can 
> specify a value
> that is rendered as  attribute on the INPUT html tag, to overwrite the
> default "on" value.
> But if i specify a value, check box is not rendered correctly.
> 
> In the doStartTag method, to render the checkbox as checked, 
> are tested
> condition for "yes", "true" and "on" values, but not for the "value"
> instance variable.
> original code is:
> 
> if (checked.equalsIgnoreCase("true")
>             || checked.equalsIgnoreCase("yes")
>             || checked.equalsIgnoreCase("on"))
> results.append(" checked=\"checked\"");
> 
> I think that correct code is :
> 
> if (checked.equalsIgnoreCase("true")
>             || checked.equalsIgnoreCase("yes")
>             || checked.equalsIgnoreCase("on")
>             || checked.equalsIgnoreCase(this.value))
> results.append(" checked=\"checked\"");

Look at the corresponding block of code in "MultiboxTag.java".  I have a
feeling there isn't a concise statement about this in the documentation, but
you use "checkbox" if you want to check for boolean values, and you use
"multibox" if you want to check for "symbols" (can't think of a better way
to say that).  The other difference is that "checkbox" compares against a
single value, and "multibox" checks against an array of values.

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to