Christopher Arndt, el 16 de febrero a las 20:15 me escribiste:
> 
> Leandro Lucarella schrieb:
> > I tried to add a JSSource("MochiKit.DOM.focusOnLoad('form_usuario');") to
> > the form but I get this error:
> > AttributeError: 'JSSource' object has no attribute 'label'
> 
> How do you add it to the form? You have to append it to the 'javascript'
> attribute of the form object:
> 
>     form = TableForm(fields=[...])
>     form.javascript.append(JSSource('...'))

Mmm, I'm using this but I have a problem, 'javascript' is a class
attribute, not an instance one, so every form in which I do
form.javascript.append() it's then rendered in the page, so I have
multiple JSSource setting focus to different form elements.

form.javascript = [JSSource(...)] is not an option either because the
TableForm class end up with just the last processed form javascript.

Is there any other way to overcome this issue than subclassing TableForm
for each form I have to add some javascript?

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
 .------------------------------------------------------------------------,
  \  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /
   '--------------------------------------------------------------------'
Borrowing money from a friend is like having sex. It just completely changes
the relationship.
        -- George Constanza

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to