Hello.

I'm using h.link_to() to stick some prototype/scriptalicious effects on the display/undisplay of dom elements. So far, so good. Very nice feature.

It seems that most of the work in events and chaining events requires doing a round-trip with the server (AJAX) but I just want to do several client side events. I see the "before" and "after" and "complete" etc... but one can't use these to chain up client side scripts that don't have a server component, right?

I think that MochiKit has some _javascript_ implementation of twisted's Deferred object, and the chaining thereof, right? Can one use that with webhelpers?

Specifically, I want to change the "display" style characteristic of a dom element (using an effect is nice). This element contains a form input. After I show it, I want to set the focus into the form element, but since link_to() uses the onclick to pass scriptalicious items to the function, I can't stick any "real" _javascript_ code in there. I don't think that there is an ondisplay() event, and of course, the bit is already loaded, so onload() doesn't work.

I looked through the source, and see how link_to parses the parameters to build attributes, and I thought that maybe I could send a tuple or a list in for onclick, but that just results in a string literal of what I sent to the function ending up html encoded in the output.

So, in summary it seems that there is no way to use link_to() to do stuff like this:
<a href="" alert('foo2');">Hi</a>

Of course, without the framework, I would do this:
<script>
function go() {
    alert('foo1');
    alert('foo2');
}
<a href="" >
But with that, I still can't use scriptalicious or 'canned' effects.

Should I just bail on using link_to() and build my link by hand in my template, calling effects manually? Or perhaps MochiKit?

Thanks again for all of your help!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to