rendering patterns with different data types

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I have to understand how renderers, slots and patterns work. I try to read examples and tutorials, but doubts remain: above all I'm a newbye.
Suppose I have an item such that (values to be rendered are uppercased):
<li> <input type="text" value="INPUT_VALUE"/>
<select name="foo"> ... <option>OPTION_VALUES</option> ... </select>
<textarea name="bar">TEXT_VALUE</textarea> </li>
Now, this item has to be repeated N times. To do that, I have a python list, each element such that:
{ 'INPUT_VALUE: 'foo', 'OPTION_VALUES': ['a', 'list', 'of', 'strings'], 'TEXT_VALUE': "bar" }
ie a list of dicts.
It would be nice to use nevow:data="my_list", nevow:render="mapping" and nevow:slots. Maybe this is the wrong way, because I cannot find how. The questions:
1- If with
<textarea nome="bar"> <nevow:slot name="TEXT_VALUE"/> </textarea>
I can correctly fill the textarea, how can I correctly fill the INPUT_VALUE? It is inside the input tag options, not inside the input tag contents.
2- What about the OPTION_VALUES? Is it possible to "subpattern" a pattern? If yes, how?
Finally, I'm wondering if this is the correct way to render such item or if a better, more elegant, solution, exists.
thanks br
- -- efphe Today is Setting Orange, the 35th day of Chaos in the YOLD 3174
participants (1)
-
Federico Tomassini