[Zope3-Users] ++skin++Boston bug
dev at projekt01.ch
dev at projekt01.ch
Wed May 24 03:33:56 EDT 2006
Hi Marco
your part looks good to me. The use of widget_row in
ObjectWidget not...
What happen is, the Boston skin uses a table for
rendering a label field block. Why this and not CSS.
Simply because the left "label" side has a nother
backgrund color. And this isn't possible with CSS.
But doesn't matter if this make sense or not. You need
to register a different widget_row like tempalte for
the ObjectWidget. This tempalte should not use nested
tables. This would mean that the second broken "td, tr"
rendering part goes away.
Please add also a issue in the bug tracker.
Regards
Roger Ineichen
_____________________________
END OF MESSAGE
> -----Original Message-----
> From: Marco Mariani [mailto:marco at sferacarta.com]
> Sent: Wednesday, May 24, 2006 7:20 AM
> To: dev at projekt01.ch
> Cc: zope3-users at zope.org
> Subject: Re: [Zope3-Users] ++skin++Boston bug
>
> dev at projekt01.ch wrote:
> > Hi Marco
> >
> > [...]
> >> /me guesses this has to do with using the widget_row macro inside
> >> another widget_row, thus trying to render
> >> <tr><td><tr><td>....</td></tr></td></tr> and the browser
> closes the
> >> fieldset, td and tr when it encounters a <td><tr> sequence.
> >
> > There is something wrong if you get a widget_row inside a
> widget_row.
> > What did you register that this nested widget/widget get happen?
>
> Here it is:
>
>
>
> ---------------------
> person/configure.zcml
> ---------------------
> <configure xmlns="http://namespaces.zope.org/zope"
> i18n_domain="person" >
>
>
> <!-- PERSON -->
>
> <interface
> interface=".IPerson"
> type="zope.app.content.interfaces.IContentType"/>
>
> <class class=".Person">
> <factory
> id="person.Person"
> description="Person"
> />
> <require
> permission="zope.View"
> interface=".IPerson"
> />
> <require
> permission="zope.ManageContent"
> set_schema=".IPerson"
> />
> </class>
>
>
> <!-- FAMILY -->
>
> <interface
> interface=".IFamily"
> type="zope.app.content.interfaces.IContentType"
> />
>
> <class class=".Family">
> <factory
> id="person.Family"
> description="Family"
> />
> <require
> permission="zope.View"
> interface=".IFamily"
> />
> <require
> permission="zope.ManageContent"
> set_schema=".IFamily"
> />
> </class>
>
>
> <include package=".browser" />
>
> </configure>
>
>
>
>
> ------------------
> person/__init__.py
> ------------------
> from zope.interface import Interface, implements from
> zope.schema import TextLine, Object, List, Choice, Field from
> persistent import Persistent
>
>
> class IPerson(Interface):
> name = TextLine(title=u'Name')
>
>
> class Person(Persistent):
> implements(IPerson)
>
> name = ''
>
>
> class IFamily(Interface):
>
> mother = Object(title=u'Mother',
> schema=IPerson)
>
> father = Object(title=u'Father',
> schema=IPerson)
>
>
> class Family(Persistent):
> implements(IFamily)
>
> mother = ''
> father = ''
>
>
>
>
> -----------------------------
> person/browser/configure.zcml
> -----------------------------
> <configure
> xmlns:zope="http://namespaces.zope.org/zope"
> xmlns="http://namespaces.zope.org/browser">
>
>
> <page
> class=".forms.FamilyAdd"
> name="AddFamily.html"
> permission="zope.ManageContent"
> for="zope.app.container.interfaces.IAdding"
> />
>
> <addMenuItem
> factory="person.Family"
> title="Family"
> description="New Family"
> permission="zope.ManageContent"
> view="AddFamily.html"
> />
>
> </configure>
>
>
>
>
> -----------------------
> person/browser/forms.py
> -----------------------
> from zope.formlib.form import Fields, AddForm, EditForm from
> person import Person, IPerson, Family, IFamily from
> zope.app.form.browser import ObjectWidget from zope.app.form
> import CustomWidgetFactory
>
>
> class FamilyAdd(AddForm):
> form_fields = Fields(IFamily)
> form_fields['mother'].custom_widget =
> CustomWidgetFactory(ObjectWidget, Person)
> form_fields['father'].custom_widget =
> CustomWidgetFactory(ObjectWidget, Person)
>
> def create(self, data):
> family = Family()
> family.mother = data['mother']
> family.father = data['father']
> return family
>
>
>
>
>
>
More information about the Zope3-users
mailing list