[Zope3-dev] Re: Missing widget data and error handling

Marius Gedminas mgedmin at b4net.lt
Tue Jul 27 18:28:38 EDT 2004


On Tue, Jul 27, 2004 at 03:00:42PM -0500, Garrett Smith wrote:
> Marius Gedminas wrote:
> >I've just discovered what I think is a small bug in the form machinery
> >(zope.app.form.utility.getWidgetsData, to be precise).
> 
> >Some input widgets do not.  One particular
> >instance is RadioWidget -- if none of the radio buttons is selected, the
> >browser will not send that input field when submitting the form.  As a
> >result, a rendered RadioWidget never displays the error message saying
> >that required input is missing.
> 
> This sounds like a bug in the radio button widget -- it needs to 
> implement hasInput without relying on form input submitted from input 
> elements of type 'radio'. This problem comes up with checkbox widgets as 
> well.

As far as I understand, hasInput of the RadioWidget correctly returns
False in this instance (i.e. when none of the radio buttons is
selected).  Do you want to say that hasInput should return True and that
getInputValue should raise a validation error?

> I briefly glanced at the itemswidget.py module (I assume this is the 
> code you're referring to) and it does use an 'empty' marker, but may not 
> be doing so correctly.
> 
> Feel free to add this as a collector issue. If the original authors 
> don't have the time to look into this, I can take a more in depth look.

I'll do this tomorrow, I'm too sleepy to do that now.

Marius Gedminas
-- 
Woe unto them that rise up early in the morning -- Isaiah 5:11
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20040728/897653dd/attachment.bin


More information about the Zope3-dev mailing list