LJAX afterfunc Timing

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LJAX afterfunc Timing

Justin Dennis
Hello All -

I'm seeking guidance on how to run an "afterfunc" function *after*  
the Lasso.includeTarget has finished updating the page. I notice that  
now it seems to fire the afterfunc immediately after making the LJAX  
request, but before the response is processed and re-integrated into  
the page.

My LJAX request with afterfunc parameter looks like this:

> Lasso.includeTarget(item, {args: postparams, afterfunc:  
> Effect.BlindDown(item, {duration:.75})});

My intended result is to load the new content into a div with  
"style=display:none;", and then use the script.aculo.us  
Effect.BlindDown() function to show the div with the content from the  
LJAX response.

The above code works, but it messes up the visual effect because  
Effect.BlindDown fires before the content is loaded in to the div.  
This causes Effect.BlindDown to expand the hidden div to a small  
height and then when the LJAX request is done processing, the div  
jumps to the right size to hold everything.

I have used the LJAX enhancements provided in the TOTW article, which  
allowed me to run the Effect.BlindDown() function from within the  
LJAX response. This achieved my desired results, but it won't work in  
Windows IE 7.

I'm happy to use either afterfunc or the <script> tag inside the LJAX  
response, if either will work reliably in Safari, Fire Fox, IE 7.

Thank you in advance for any help you can provide.

- Justin

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LJAX afterfunc Timing

Justin Dennis
Hello -

Still in need of help with this LJAX issue:

> I'm seeking guidance on how to run an "afterfunc" function *after*  
> the Lasso.includeTarget has finished updating the page. I notice  
> that now it seems to fire the afterfunc immediately after making  
> the LJAX request, but before the response is processed and re-
> integrated into the page.

Any Ideas? Full description below. Thank you in advance.

- Justin






> My LJAX request with afterfunc parameter looks like this:
>
>> Lasso.includeTarget(item, {args: postparams, afterfunc:  
>> Effect.BlindDown(item, {duration:.75})});
>
> My intended result is to load the new content into a div with  
> "style=display:none;", and then use the script.aculo.us  
> Effect.BlindDown() function to show the div with the content from  
> the LJAX response.
>
> The above code works, but it messes up the visual effect because  
> Effect.BlindDown fires before the content is loaded in to the div.  
> This causes Effect.BlindDown to expand the hidden div to a small  
> height and then when the LJAX request is done processing, the div  
> jumps to the right size to hold everything.
>
> I have used the LJAX enhancements provided in the TOTW article,  
> which allowed me to run the Effect.BlindDown() function from within  
> the LJAX response. This achieved my desired results, but it won't  
> work in Windows IE 7.
>
> I'm happy to use either afterfunc or the <script> tag inside the  
> LJAX response, if either will work reliably in Safari, Fire Fox, IE 7.
>
> Thank you in advance for any help you can provide.
>
> - Justin


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LJAX afterfunc Timing

Paul Melia

On Feb 8, 2007, at 9:05 AM, Justin Dennis wrote:

> Hello -
>
> Still in need of help with this LJAX issue:
>
>> I'm seeking guidance on how to run an "afterfunc" function *after*  
>> the Lasso.includeTarget has finished updating the page. I notice  
>> that now it seems to fire the afterfunc immediately after making  
>> the LJAX request, but before the response is processed and re-
>> integrated into the page.
>
> Any Ideas? Full description below. Thank you in advance.
>
> - Justin

Justin,

I have not yet used LJAX in a solution so this is pure speculation...

Prototype has a function called "onComplete" that I use often. It  
waits for a response from the remote server before proceeding to the  
next set/stage of instructions.
I haven't dug deep into the "guts" of Prototype, but I imagine that  
it is using some sort of token routine as the control.

If that is true, and LJAX's "afterfunc" is suppose to be an analogous  
operation, then maybe these ideas (in no particular order) can help  
you towards a solution...

- pass a value in your first stage of the request (complete = 0) and  
have the server-side function modify it (complete = 1). Have your  
client-side effect test for the correct value and fire only when the  
value is found.

- put a timer in between the server request and firing of the  
blind.down. Set it to a length that is a bit longer than the average  
request time. Not pretty and prone to firing with unexpected results  
(server congestion causes delays and therefore no content at firing,  
etc).

- try troubling shooting (if you are not already doing so) with  
FireFox and the Web Developer and FireBug plugins. They can provide a  
wealth of information on what is actually going on behind the scenes.

- try the routine using Prototype - this way you can tell if the  
issue is in the ajax structure or a possible bug in LJAX.

HTH,
Paul

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LJAX afterfunc Timing

Justin Dennis
Thank you, Paul, for your suggestions. I've had tunnel vision on this  
one, so I appreciate the different perspective on working-around and  
troubleshooting the problem.

- Justin


> I have not yet used LJAX in a solution so this is pure speculation...
>
> Prototype has a function called "onComplete" that I use often. It  
> waits for a response from the remote server before proceeding to  
> the next set/stage of instructions.
> I haven't dug deep into the "guts" of Prototype, but I imagine that  
> it is using some sort of token routine as the control.
> ...

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LJAX afterfunc Timing

Fletcher Sandbeck
In reply to this post by Justin Dennis
> Still in need of help with this LJAX issue:
>
> > I'm seeking guidance on how to run an "afterfunc" function *after*  
> > the Lasso.includeTarget has finished updating the page. I notice  
> > that now it seems to fire the afterfunc immediately after making  
> > the LJAX request, but before the response is processed and re-
> > integrated into the page.
>
> Any Ideas? Full description below. Thank you in advance.

We have a new version of the LJAX.LassoApp which should work with IE7 so
you can use the script method of performing code after the update.  This
code has been tested in IE6, IE7, FireFox 2, and Safari.

The code files included with the tip have been updated so you can get
the new LJAX.LassoApp from there.

<http://www.omnipilot.com/TotW.1768.9220.lasso>

Please let us know if you have any problems with this new method.

[fletcher]
--
Fletcher Sandbeck                         [hidden email]
Director of Product Development       http://www.lassostudio.com
OmniPilot Software, Inc.                http://www.omnipilot.com

============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LJAX afterfunc Timing

Justin Dennis
Wonderful news! Thanks, [fletcher].

- Justin


> We have a new version of the LJAX.LassoApp which should work with  
> IE7 so
> you can use the script method of performing code after the update.  
> This
> code has been tested in IE6, IE7, FireFox 2, and Safari.
>
> The code files included with the tip have been updated so you can get
> the new LJAX.LassoApp from there.
>
> <http://www.omnipilot.com/TotW.1768.9220.lasso>


============================================
Attend the Lasso Summit
March 2-4, 2007 in Fort Lauderdale, FL
http://www.LassoSummit.com/
============================================

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage