ColdFusion 8, DIV, "Loading" graphic issue

Here is something interesting I just ran into. One of my open bugs at work involve adding a “Loading” graphic to an ajax container. The code in question uses CFDIV and hits up a CFC to load the data.

I thought about it this for a second and thought to myself, “Self - doesn’t CF8 automatically do loading graphics?”

I whipped up a quick test to confirm this:

<cfdiv bind="url:test3.cfm" />

and test3.cfm just did:

<cfset sleep(5000)> test 3

When I ran this I plainly saw a loading message and graphic. So why wasn’t it working in our product? I noticed that the code used cfc:, not url:, so I quickly modified my test:

cfc:<br> <cfdiv bind="cfc:test.getslow()" />

<p> url:<br> <cfdiv bind=”url:test3.cfm” /> </code>

The CFC method getslow did the same thing test3.cfm did. When I ran this I saw:

As you can see, the CFC based one has no form of loading message while the URL one does. I could switch to a URL based CFC call, but this is rather odd. I can’t see why one form of remote call would get a message and another would not.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments