[CPS-devel] Two questions about widgets...

Georges Racinet gracinet at nuxeo.com
Tue Feb 14 13:03:29 CET 2006


On Feb 14, 2006, at 12:38 PM, bruno desthuilliers wrote:

> Hello hi,
>
> Two questions about widgets and layouts and schemas...
>
> 1/ I have a member schema with 3 "custom" zones (CPS String  
> fields). I'd
> like to use portal properties to set the labels of the corresponding
> widgets (String widgets or like), so the portal admin can set whatever
> label pleases him. Is there an easy way to do so ? I failed to
> understand exactly how a string widget is rendered (didn't found  
> a .pt,
> and the render() method of string widget seems to only care about the
> content, not the label... or did I miss something ?)

Hi,

The labels are extracted from the widget by the layout zpt (check  
layout_lib_div_view for instance).
You can put whatever label you want, it will go through the  
translation system according to the is_i18n property.
That's why most labels are actually identifiers like  
cpsdoc_Image_label_edit.

>
> 2/ I have what I thought would be a common use case : for a given (CPS
> String) field, propose the user a selection list *and* a text input  
> for
> values that are not in the list. But I failed to find a widget doing
> this. Does such a beast exist ?

I don't think so.

> Or is this problem best solved by using
> two widgets (a selection and a string widget) and using write  
> expression
> to retrieve the value from the appropriate widget ?

I'm not very found of this, because at first sight you'd need two  
fields. On the other hand, this might be inavoidable since select  
widgets store an id in a vocabulary, rather than the end-user string.

---------
Georges Racinet                        Nuxeo SAS
gracinet at nuxeo.com                http://nuxeo.com
Tel: +33 (0) 1 40 33 71 73




More information about the cps-devel mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.