[Twisted-Python] woven: one <input> for each ListItem

Using woven, how do I create an <input/> for each Item in a List? e.g. suppose I wanted to do something like <table model="aList" view="List"> <tr> <td><input ???/></td> ... want these replicated </tr> </table> how would I go about this? I've tried a few guesses based on the examples, but aren't getting anywhere. thanks John Kozak

On Sun, 29 Dec 2002 04:56:07 +0000, "John Kozak" <jk@xylema.org> wrote:
Here you probably want something like <td listItemOf="aList"> <input view="setMyName" /> </td> (setMyName is an imaginary view, but I am pretty sure you'll want the input widget to have a different name based on what the listItem is...) That will repeat the <td> tag multiple times. If you wanted to literally repeat the input tag, then <input listItemOf="aList" view="setMyName" /> would work. By the way: you don't need the 'view="List"' attribute on your <table> tag if the model aList is actually an instance of 'list' -- woven will use appropriate views for various basic types.
Hope that helps. -- | <`'> | Glyph Lefkowitz: Traveling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |

On Sun, 29 Dec 2002 04:56:07 +0000, "John Kozak" <jk@xylema.org> wrote:
Here you probably want something like <td listItemOf="aList"> <input view="setMyName" /> </td> (setMyName is an imaginary view, but I am pretty sure you'll want the input widget to have a different name based on what the listItem is...) That will repeat the <td> tag multiple times. If you wanted to literally repeat the input tag, then <input listItemOf="aList" view="setMyName" /> would work. By the way: you don't need the 'view="List"' attribute on your <table> tag if the model aList is actually an instance of 'list' -- woven will use appropriate views for various basic types.
Hope that helps. -- | <`'> | Glyph Lefkowitz: Traveling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
participants (2)
-
Glyph Lefkowitz
-
John Kozak