Karl Guertin wrote:
> On 1/3/06, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> > No such widget exists yet, to my knowledge.
>
> Ticket #326 has the approach I've been taking to this, but it has issues.

I can't say I really like the idea of having form names like
"addresses-1.firstName",  "addresses-2.firstName",
"addresses-3.firstName" unless there is an easy javascript way to cycle
through all the addresses and get the fields. If we had several names
of something like "addresses.firstName" you could access it in
javascript with

document.my_form_name["addresses.firstName"] and you would get an array
if there was more than one field with that name. If it was had a -1 in
the name, you'd have to write a funky loop to substitute an integer
into the key name.

Plus, cherrpy will turn all the addresses.firstName into a list for us,
for free, the only thing we'd even need to (maybe) do is a filter to
turn {'addresses.firstName':[...]} into {'addresses':
{'firstName':[...]}}. I think that last bit would be a good idea
anyways, so people not using a widget could do something like

def foo(self, addresses):
  ...
  return dict(...)

since a form name with a period in it would otherwise require us to use
kwargs.

At least the javascript wouldn't be a pain. And *we are* planning on
adding AJAX to our TableForm widget eventually, right, so why make it a
pain later?

Reply via email to