[Zope3-dev] Re: Display widget for IText and ITextLine

Tahara Yusei yusei at domen.cx
Thu Dec 7 10:47:12 EST 2006


Hi,

> do you want the widget to display the value and then
> pass the original value back in?  If so, you could just use an
> EditWidget in its disabled / read-only mode.

Yes, right. I want to display value and pass the value to next page.
So, my use case is to display value from request.

My zpt code is
"""
<span replace="structure widget"></span>
<span replace="structure widget/hidden"></span>
"""

And I expect the following html, but if I use IText or ITextLine,
the result is difference.

"""
Zope
<input type="hidden" value="Zope">
"""

Some display widgets can render a hidden input tag by hidden() method
(For example, a widget for IChoice), but DisplayWidget cannot.

And another problem is about to display value from request.
Some display widgets can get value from request by _toFieldValue(),
then we only call __call__ method for display value.
but DisplayWidget cannot get value by itself. We always need to get
value from request explicitly and pass the value to setRenderedValue
method.

These difference between widgets are obscure to me(and probably most
beginners).I think widgets for frequently used fields should be same
behavior.

Thank you,
-- 
Tahara Yusei
yusei at domen.cx


More information about the Zope3-dev mailing list