[BUGS] CheckboxTag with value property

2002-10-22 Thread Franco Caponi
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\);


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




RE: [BUGS] CheckboxTag with value property

2002-10-22 Thread Karr, David
 -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




RE: [BUGS] CheckboxTag with value property

2002-10-22 Thread Byrne, Steven
I have to disagree.  It's perfectly legitimate for a single checkbox to
have a value that's not one of on, yes or true.
That's legit HTML.  Struts currently (seemingly needlessly) prevents
that usage by only having an annointed set of values, and forcing users
to use those.   I think Franco is correct; I had a similar thought
myself several months back, but didn't take the time to file a bug on
it.

+1 to Franco's proposed change.

Steve

 -Original Message-
 From: Karr, David [mailto:david.karr;attws.com]
 Sent: Tuesday, October 22, 2002 1:11 PM
 To: 'Struts Developers List'
 Subject: RE: [BUGS] CheckboxTag with value property
 
 
  -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


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




CheckboxTag

2001-08-28 Thread Anton
Hello
I would like to contribute to STRUTS project.
I found a bug in CheckboxTag and I have a fix for it.
How can I submit my changes to CVS or to some place for "Commiters" to review my changes? 
Thank you.
Anton.Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! Messenger.

Re: CheckboxTag

2001-08-28 Thread Martin Cooper

The best thing to do would be to enter a bug in the bug database. The bug 
database is at http://nagoya.apache.org/bugzilla/. If you have a patch too, 
you can attach it to the bug entry.

Thanks!

--
Martin Cooper


At 12:13 PM 8/28/01, Anton wrote:

Hello

I would like to contribute to STRUTS project.

I found a bug in CheckboxTag and I have a fix for it.

How can I submit my changes to CVS or to some place for Commiters to 
review my changes?

Thank you.

Anton.



Do You Yahoo!?
Make http://phonecard.yahoo.com/international calls for as low as 
$0.04/minute with Yahoo! Messenger.