[Zope3-dev] widget question: propertyNames/getValue
Gary Poster
gary at modernsongs.com
Thu Feb 19 14:33:17 EST 2004
Gary Poster wrote:
> I'd really like a schema of the configurables, though, because then we
> could make zcml do one of those "if I don't know the attribute I'll try
> to see if the widget class's schema knows about it, and use it to cast
> the zcml value" tricks. You know, one of those. :-) So we could have
> <addform ...>
> <widget class=".widgets.DatePicker" format="%Y-%m-%d" />
> </addform>
>
> where format is cast as appropriate, as defined in the widget
> configuration schema (ok, it's easy in this case, but you see what I
> mean), and then CustomWidgetFactory is called with the class, setting
> the format.
>
> That would be nice. Generating a view class on the file system just to
> make my text field display at 50 characters wide feels overly heavy to me.
>
> Gary
More thoughts on this, as we near the landing of Garrett's
widget-geddon. :-) I'm hoping to implement what I discuss here, so this
is request for comments.
In line with what I said above, I'd like to be able to explicitly
override labels in zcml too.
<addform ...>
<widget class=".widgets.DualListWidget">
<label id="available_items" value="Available Vehicles" />
<label id="selected_items" value="Selected Vehicles" />
</widget>
</addform>
This would let the zcml component of the message id extraction tool
catch these sorts of changes. Implementation-wise, my first take on
this is to have a label dictionary as part of the widget interface...and
this would also mean that every widget would have to get display text
from this dictionary in order to play nicely. Garrett, do you have any
concerns? Is this something you're already beginning to address?
Anyone else?
(Thanks to Philipp and Jim for recently clarifying the ZCML message id
story for me, btw :-)
Gary
More information about the Zope3-dev
mailing list