[Zope] TAL::Selecting the current value in a select box

Chris Withers chrisw@nipltd.com
Sun, 02 Jun 2002 15:26:32 +0100


Oliver Marx wrote:
> 
> I have used your example - could you clarify some asspects?
> 
> <select>
>    <tal:r repeat="item here/SelectBoxData">
>       <option tal:attributes="value    item/value;
>                               selected python:item.value==current_value;"
>               tal:content="item/text">Dummy Content</option>
>    </tal:r>
> </select>
> 
> tal:r - I'm not sure I understand this tag, and I couldn't find any
> documentation in the ZopeBook. What am I missing?

anything in the tal or metal namespaces isn't output to the browser. The r bit
is just a dummy tag.

> selected python:item.value==current_value;" - Why does this tag produce
> selected="selected" and not just selected?

Boolean magic of ZPT ;-)

cheers,

Chris