[Zope3-dev] enahnced widget usecase
Garrett Smith
garrett at mojave-corp.com
Fri Oct 1 10:04:44 EDT 2004
dev at projekt01.ch wrote:
> Hi together,
>
> How can I handle this widget usecase:
>
> A object has simply IText fields like:
>
> title, description, body
>
> I whould like to show a edit view where
> the field title and description displayed but
> not editable and the body field is rendered
> with his relevant edit widget.
The simplest way is to define two attributes in your view class:
title_widget = CustomWidgetFactory(DisplayWidget)
description_widget = CustomWidgetFactory(DisplayWidget)
You could adapt the context to a schema that had readonly title and
description fields, but this is a lot more work than explicitly
specifying the widget classes to use, per the example above.
-- Garrett
More information about the Zope3-dev
mailing list