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

Garrett Smith garrett at mojave-corp.com
Wed Jul 28 17:17:11 EDT 2004


Marius Gedminas wrote:

> 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?

It should return True -- that's the problem.

  -- Garrett



More information about the Zope3-dev mailing list