Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SelectionWidget bug?: first value selected automatically
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Harald Friessnegger  
View profile  
 More options May 18 2009, 11:38 am
From: Harald Friessnegger <har...@webmeisterei.com>
Date: Mon, 18 May 2009 17:38:36 +0200
Local: Mon, May 18 2009 11:38 am
Subject: [Plone-Users] SelectionWidget bug?: first value selected automatically
When i define a StringField with an optional value using a SelectionWidget i
get two different behaviours depending on the type of selectionwidget i
use::

  atapi.StringField('floor',
      required = False,
      vocabulary = ['one','two','three']
      widget = atapi.SelectionWidget(
          label = _(u"Floor"),
          type = 'radio',
          ),
      )

for type=='radio' i get five options, no option is chosen. submitting the
form w/o touching the widget will result in context.floor == ''::

  [] one
  [] two
  [] three

for type=='select' i get a pulldown with 'one' pre-selected. submitting the
form w/o touching this widget results in context.floor=='one'

To use a pulldown w/o having 'one' set by default i'd need to define

  vocabulary = ['','one','two','three']

which would result in a useless selectable value in case we switch back to
type=='radio'

Is there a _good_ reason archetype's selectionwidget does not automatically
add an empty choice if required==False and type=='select'???

How did other people work around this problem (i'm sure i'm not the first
one struggling with this)?

regards, fRiSi

--
Webmeisterei GmbH - Büro für Netzfragen
Tel: +43 5572 908877,  Fax: +43 5572 908877-66
Steinebach 18, A-6850 Dornbirn
http://www.webmeisterei.com

--------------------------------------------------------------------------- ---
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Plone-Users mailing list
Plone-Us...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raphael Ritz  
View profile  
 More options May 19 2009, 3:02 am
From: Raphael Ritz <r.r...@biologie.hu-berlin.de>
Date: Tue, 19 May 2009 09:02:25 +0200
Local: Tues, May 19 2009 3:02 am
Subject: Re: [Plone-Users] SelectionWidget bug?: first value selected automatically

Harald Friessnegger wrote:
> When i define a StringField with an optional value using a SelectionWidget i
> get two different behaviours depending on the type of selectionwidget i
> use::

I'd call it a bug.

In ATExtensions I work around this by having an optional
argument to 'getDisplayList' (defined in there) which I
use as a basis for controlled vocabularies managed in ZMI
to add the empty entry in front if needed.

Raphael

--------------------------------------------------------------------------- ---
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Plone-Users mailing list
Plone-Us...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harald Friessnegger  
View profile  
 More options May 20 2009, 10:24 am
From: Harald Friessnegger <har...@webmeisterei.com>
Date: Wed, 20 May 2009 16:24:55 +0200
Local: Wed, May 20 2009 10:24 am
Subject: Re: [Plone-Users] SelectionWidget bug?: first value selected automatically
thx raphael.

i submitted a bug (https://dev.plone.org/plone/ticket/9212) and will stick
with the
vocabulary = ['','one','two','three']
solution in the meantime..

regards, fRiSi

--
Webmeisterei GmbH - Büro für Netzfragen
Tel: +43 5572 908877,  Fax: +43 5572 908877-66
Steinebach 18, A-6850 Dornbirn
http://www.webmeisterei.com

--------------------------------------------------------------------------- ---
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Plone-Users mailing list
Plone-Us...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »