Re: [Zope3-Users] default text for dropdown widget empty selection
On Tuesday 02 January 2007 14:10, Roy Mathew wrote: Currently, the builtin dropdown widgets show the string '(no value)' as the empty default. Is it possible to show different text in its place? Yes, you have three choices: 1. Provide a translation for English to change it globally. 2. Subclass the original widget and change the ``_messageNoValue`` attribute. You can either register this new widget or set it as the custom widget. 3. After the widgets are created/instantiated in the form, set ``_messageNoValue``. 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
Re: [Zope3-Users] default text for dropdown widget empty selection
You can override the setupWidgets() method of your formlib class and write something like this. (assuming that project is your dropdown field and your view is called MyAddingView) def setUpWidgets(self, ignore_request=False): super(MyAddingView, self).setUpWidgets(ignore_request=ignore_request) self.widgets['project']._messageNoValue = (no project) The thing that bothers me is that once you assign a value it is not possible to set it back to no value. Anyone knows how to fix this? Dennis Roy Mathew escribió: Hi Folks, Currently, the builtin dropdown widgets show the string '(no value)' as the empty default. Is it possible to show different text in its place? ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users