RE: [Zope3-Users] ++skin++Boston bug

2006-05-24 Thread dev
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:[EMAIL PROTECTED] 
> Sent: Wednesday, May 24, 2006 7:20 AM
> To: [EMAIL PROTECTED]
> Cc: zope3-users@zope.org
> Subject: Re: [Zope3-Users] ++skin++Boston bug
> 
> [EMAIL PROTECTED] wrote:
> > Hi Marco
> > 
> > [...]
> >> /me guesses this has to do with using the widget_row macro inside 
> >> another widget_row, thus trying to render 
> >>  and the browser 
> closes the 
> >> fieldset, td and tr when it encounters a  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
> -
> http://namespaces.zope.org/zope"; 
> i18n_domain="person" >
> 
> 
>   
> 
>interface=".IPerson"
> type="zope.app.content.interfaces.IContentType"/>
> 
>   
>  id="person.Person"
> description="Person"
> />
>  permission="zope.View"
> interface=".IPerson"
> />
>  permission="zope.ManageContent"
> set_schema=".IPerson"
> />
>   
> 
> 
>   
> 
>interface=".IFamily"
> type="zope.app.content.interfaces.IContentType"
> />
> 
>   
>  id="person.Family"
> description="Family"
> />
>  permission="zope.View"
> interface=".IFamily"
> />
>  permission="zope.ManageContent"
> set_schema=".IFamily"
> />
>   
> 
> 
>   
> 
> 
> 
> 
> 
> 
> --
> 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
> -
>  xmlns:zope="http://namespaces.zope.org/zope";
> xmlns="http://namespaces.zope.org/browser";>
> 
> 
>class=".forms.FamilyAdd"
> name="AddFamily.html"
> permission="zope.ManageContent"
> for="zope.app.container.interfaces.IAdding"
> />
> 
>factory="person.Family"
> title="Family"
> description="New Family"
> permission="zope.ManageContent"
> view="AddFamily.html"
> />
> 
> 
> 
> 
> 
> 
> ---
> 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
> 
> 
> 
> 
> 
> 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ++skin++Boston bug

2006-05-23 Thread Marco Mariani
[EMAIL PROTECTED] wrote:
> Hi Marco
> 
> [...]
>> /me guesses this has to do with using the widget_row macro 
>> inside another widget_row, thus trying to render 
>>  and the browser 
>> closes the fieldset, td and tr when it encounters a  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
-
http://namespaces.zope.org/zope"; i18n_domain="person" >


  

  

  



  


  

  

  



  


  






--
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
-
http://namespaces.zope.org/zope";
xmlns="http://namespaces.zope.org/browser";>


  

  






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





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


RE: [Zope3-Users] ++skin++Boston bug

2006-05-23 Thread dev
Hi Marco

[...]
> 
> /me guesses this has to do with using the widget_row macro 
> inside another widget_row, thus trying to render 
>  and the browser 
> closes the fieldset, td and tr when it encounters a  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?

Regards
Roger Ineichen

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ++skin++Boston bug

2006-05-23 Thread Marco Mariani
I'm using the Boston skin (from SVN) with Zope 3.3.0b1


My Object Widgets, that in Rotterdam are well rendered:


+- Mother --+
|   |
|  Name _   |
|   |
+---+

+- Father --+
|   |
|  Name _   |
|   |
+---+



are broken when using Boston:

+- Mother --+
|   |
+---+

 Name _

+- Father --+
|   |
+---+

 Name _



Basically, the fieldset tag is closed before rendering the custom widget


relevant snippet, Rotterdam:

  

  Mother
  

[...]



Boston:

  

  Mother
  
  

  


  

[...]






Commenting out the  and  from Boston renders the fieldset in the
right place



/me guesses this has to do with using the widget_row macro inside
another widget_row, thus trying to render
 and the browser closes the
fieldset, td and tr when it encounters a  sequence.

Tested with FF and konq, maybe it works with IE :-)







___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users