Got a combination CF & jQuery question for those of you who use
both.usually, I can get
a better response from folks who use CF & jQuery than I can from those who
use only jQuery.
I've got an ajax call (not AJAX call.) that inserts property data into a
database then processes from 1 to usually
no more than around 10 images, creating multiple sizes, etc.
The problem I'm having is that the ajax call, being asynchronous, returns
back to the calling
page and continues executing instructions before the images are all
processed.
If I click the button in a success dialog that I have that pops up after the
submission and before the
images are finished processing, any images that haven't been processed when
the button is clicked
don't get processed.now, I know to wait for the images to process, but my
users are going to go ahead
and click close button and interrupt the processing.
I couldn't figure out how to setup some kind of callback function to keep
everything paused
until the images are processed.
Here's the jQuery ajax call:
$.ajax ({ cache: false,
type: 'post',
url:
'rentalProperties.cfc?method=mAddRentalProperty&returnFormat=json',
dataType: 'json',
data: values,
success: function(response) {
if ( response.STATUS == 'Success' )
{ var rentalPropertyAddDialogHTML
= 'rentalPropertyAddDialogHTML.cfm?' + new Date().getTime();
$('.rentalPropertyAddDialog').fadeOut(100);
$('.rentalPropertyAddDialog').empty();
$('.rentalPropertyAddResponseDialog').fadeIn(100);
fnGetRentalProperties(); }
etc.
I looked at "ajaxSuccess" & "ajaxComplete", but I couldn't see how these
could be used
in conjunction with the processing taking place in the rentalProperties.cfc
file.
I think the exact problem area I the code above is the call to the function
"fnGetRentalProperties()", which
goes out to another cfc method and constructs HTML for display before all
the data is finished processing.
How can I set this up to instruct the browser to "wait until all the images
are processed, *then* run fnGetRentalProperties.
Suggestions?
Thanks,
Rick
----------------------------------------------------------------------------
---------------------------------------
"Those who hammer their guns into plows will plow for those who do not." -
Thomas Jefferson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326521
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4