Popup ajax form

Aug 18, 2011 at 1:14 PM

Hi,

I would like to do stuff on the client after a ajax popupform has finished loading. Is this possible?

Cheers.

Aug 18, 2011 at 1:22 PM

hi,

yes, inside the popup form you can put some js, that js will get executed when the pf will load

Aug 18, 2011 at 2:03 PM

Hi, 

Yes, but this code is executed before the form is shown. I want to set the focus to some element after the dialog is shown. It is not the first input element of the first form on the page, so the default setfocus does not work for me.

Aug 18, 2011 at 7:36 PM

yes, that's what I meant,

just put an alert('hi') and you will see when it is executed

Aug 18, 2011 at 8:23 PM

'hi' is displayed before the dialog is shown.. When using JQueryUI you could do something like:

$dialog
    .load('somecontroler...', DoStuffWhenCompleted)
    .dialog({
        ...
    });

function DoStuffWhenCompleted(..)...

Is this possible using Project Awesome? 

Cheers

Aug 18, 2011 at 9:03 PM

if you put something like this:

<script>

$(function(){ alert('hi); });

</script>

 

inside the view of an action that is used with the popupform

than until the popupform is open the content of this view is not yet in the browser

when you click the link to open the popup form the content of this action (view) comes via ajax and after that the js that came is executed