[Zope3-Users] select field with Choice widget and formlib

2007-02-07 Thread Dominique Lederer
hi

i render a form with formlib which contains a selectbox:

form_fields = Fields(
Choice(__name__='selectbox', required=False,
values=[value1,value2,value3]),
)

the rendered output always includes a extra option which contains this
message-id vocabulary-missing-single-value-for-edit

like:
option selected=selected value=Wert aus Vokabular mit einem Wert
fehlt/option
option value=value1value3/option
option value=value2value3/option
option value=value3value3/option

how do i get rid of this?

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


Re: [Zope3-Users] select field with Choice widget and formlib

2007-02-07 Thread Gary Poster


On Feb 7, 2007, at 11:30 AM, Dominique Lederer wrote:


hi

i render a form with formlib which contains a selectbox:

form_fields = Fields(
Choice(__name__='selectbox', required=False,
values=[value1,value2,value3]),
)

the rendered output always includes a extra option which contains this
message-id vocabulary-missing-single-value-for-edit

like:
option selected=selected value=Wert aus Vokabular mit einem Wert
fehlt/option
option value=value1value3/option
option value=value2value3/option
option value=value3value3/option


Your field has required=False.  How else are you supposed to show, or  
allow the choice for, *not* choosing one of your three options?



how do i get rid of this?


required=True

or write a new widget (a subclass would be easy enough probably)

Gary

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


Re: [Zope3-Users] select field with Choice widget and formlib

2007-02-07 Thread Stephan Richter
On Wednesday 07 February 2007 11:46, Gary Poster wrote:
  option selected=selected value=Wert aus Vokabular mit einem Wert
  fehlt/option
  option value=value1value3/option
  option value=value2value3/option
  option value=value3value3/option

 Your field has required=False.  How else are you supposed to show, or  
 allow the choice for, *not* choosing one of your three options?

I'll note that the translation in German is really wrong. It should jsut 
be Kein Wert or something similar. In my apps I create my own zope.pot to 
fix the translation.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users