[Zope3-dev] RE: [Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/Changed the checkbox widget to set the value attribute. The HTML 4

Roger Ineichen dev at projekt01.ch
Mon Jan 24 11:22:25 EST 2005


Hi together,

Why does the CheckBoxWidget only handle 'on' as values?

Is it not better to support the real value from a
field. This could be a string, bool, int, etc.

If we check one of this checkbox, it whould mean we
select the value behinde the widget.

This way we only can use the CheckBoxWidget as a 
boolean widget. Perhaps we can rename this 
to BoolCheckBoxWidget and implement another
CheckBoxWidget which handes real values.

Perhaps  I'm wrong,  but the MultiCheckBoxWidget
uses real values not only 'on' for booleans.


Regards
Roger Ineichen

Projekt01 GmbH
www.projekt01.ch
_____________________________
END OF MESSAGE  

> -----Original Message-----
> From: zope3-checkins-bounces at zope.org 
> [mailto:zope3-checkins-bounces at zope.org] On Behalf Of Jim Fulton
> Sent: Monday, January 24, 2005 4:53 PM
> To: zope3-checkins at zope.org
> Subject: [Zope3-checkins] SVN: 
> Zope3/trunk/src/zope/app/form/browser/Changed the checkbox 
> widget to set the value attribute. The HTML 4
> 
> Log message for revision 28925:
>   Changed the checkbox widget to set the value attribute.  The HTML 4
>   spec says this is required:
>   
>   http://www.htmlhelp.com/reference/html40/forms/input.html
>   
> 
> Changed:
>   U   Zope3/trunk/src/zope/app/form/browser/boolwidgets.py
>   U   
> Zope3/trunk/src/zope/app/form/browser/tests/test_checkboxwidget.py
> 
> -=-
> Modified: Zope3/trunk/src/zope/app/form/browser/boolwidgets.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/form/browser/boolwidgets.py	
> 2005-01-24 15:50:56 UTC (rev 28924)
> +++ Zope3/trunk/src/zope/app/form/browser/boolwidgets.py	
> 2005-01-24 15:52:51 UTC (rev 28925)
> @@ -57,6 +57,7 @@
>                            id=self.name,
>                            cssClass=self.cssClass,
>                            extra=self.extra,
> +                          value="on",
>                            **kw),
>              )
>  
> 
> Modified: 
> Zope3/trunk/src/zope/app/form/browser/tests/test_checkboxwidget.py
> ===================================================================
> --- 
> Zope3/trunk/src/zope/app/form/browser/tests/test_checkboxwi
> dget.py	2005-01-24 15:50:56 UTC (rev 28924)
> +++ 
> Zope3/trunk/src/zope/app/form/browser/tests/test_checkboxwi
> dget.py	2005-01-24 15:52:51 UTC (rev 28925)
> @@ -85,6 +85,7 @@
>            id="field.foo"
>            name="field.foo"
>            type="checkbox"
> +          value="on"
>            />
>  
>      Hidden rendering:
> @@ -114,6 +115,7 @@
>            id="field.foo"
>            name="field.foo"
>            type="checkbox"
> +          value="on"
>            />
>  
>      The checkbox widget does not support None values, so a 
> Bool required
> 
> _______________________________________________
> Zope3-Checkins mailing list
> Zope3-Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-checkins
> 



More information about the Zope3-dev mailing list