The thought on this is that there would be some kind of widget to
handle the repeating elements. (FormEncode's variabledecode stuff
would be *very* useful to that widget!)

No such widget exists yet, to my knowledge.

Kevin

On 1/3/06, Igor Murashkin <[EMAIL PROTECTED]> wrote:
>
> I was wondering if there was any thought put into TableForm being able
> to contain a list of widgets.
>
> For example TableForm([ TextField("name", default=None,
> validator=V.String())]*3) will correctly render a TableForm with <input
> name="name" .../> 3 times, but I'm not so sure it will play nice during
> validation.
>
> Even if that did work out, I would definitely prefer something like
> TableForm([ Set(]TextField("name", default=None,
> validator=V.String())], count=3) ]), with a default count being 3, but
> it could be a list of any size (and maybe it could ignore completely
> empty rows). If it's a set, it could also render <input name="name[]"
> .../> since that's how DOM handles form input arrays.
>
> Or maybe something else could be done. I just think there should be an
> easy way to have a variable # of fields, without having to hack stuff
> like <input name="name1" /> ... <input name="name2" /> .. etc. At the
> same time, when using the form for something like datacontroller's add
> method we'd want to be able to specify the # of times a set could be
> output.
>
> So Set([TextField("first_name", default=None, validator=V.String()),
> TextField("last_name", default=None, validator=V.String())],  count=3)
> could produce:
> <input type="text" name="first_name[]" /> <input type="text"
> name="last_name[]" />
> <input type="text" name="first_name[]" /> <input type="text"
> name="last_name[]" />
> <input type="text" name="first_name[]" /> <input type="text"
> name="last_name[]" />
>
> Then all the validators would be run and errors could be displayed next
> to the appropriate row, and with an option like emptyList = True, we
> could ignore rows that aren't filled out.
>
>


--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Reply via email to