[Zope3-dev] Re: browser widgets: items widgets and label tags

Philipp von Weitershausen philipp at weitershausen.de
Sat Nov 11 04:02:03 EST 2006


yuppie wrote:
> Looking at the output generated by formlib, I got the impression nobody 
> cares much about valid output.

formlib's standard template is horrible. zope.app.form's rendering is 
much better. I have no idea why formlib uses its own horrid template any 
way, it could simply have used widget_macros from zope.app.form (which 
is what I always do in my formlib forms).

>> I object; this is still a change to the contract.
> 
> Well. It depends on the point of view. This seems to be the implicit 
> contract. The templates in zope.formlib and in zope.app.form use the 
> widget name in the 'for' attribute, so they depend already on that 
> behavior. Making this contract explicit by fixing the description in the 
> interface doesn't mean to change the contract. Or does it?

The description of interface methods and attributes are part of the 
contract. We should therefore be reluctant to change them, unless

* we just add documentation

* we now explicitly state a contract that has been assumed implicitly before

>> You were on the right track with your first proposal.  There's a need
>> for widgets to provide more information to support integration in a
>> form.  Unfortunately, adding an attribute to the IWidget or other
>> existing interfaces doesn't work well, since it makes it harder to
>> write code that supports multiple versions of Zope.
> 
> So there is no way to fix interfaces? Are all interfaces completely 
> frozen? (I still have to make myself familiar with the Zope 3 policies.)

Yes, public interfaces should not change. Otherwise people implementing 
the interface in question woudl all of a sudden not fulfill the contract 
anymore when upgrading to a newer Zope version.

> This looks like overkill to me. No use case comes to my mind where 
> focusControlId would be different to labelControlId.
> 
> But if Zope 3 policies require a new interface for changes like that and 
> if we really want to stick that close to the HTML specification I'm fine 
> with adding IWidgetControlInformation.

I'm not an expert on the exact HTML mechanics here, but it always sounds 
good to me to stick close to existing specs. The HTML spec is what 
people can refer to and what people know...

-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Zope3-dev mailing list