User Submitted Tip: Refreshing a CFDIV bound to a CFC

This post is more than 2 years old.

I swear this is something I may have covered before, but I'm not finding it in my archives. Either way, it's a good tip and I wanted to share it. Markus Wollny was working with a CFDIV tag that was bound to a CFC:

<cfdiv id="ivactid" bind="cfc:article.getCuriVactid()"></cfdiv>

The problem he ran into was refreshing the data in the grid. Normally a bound CFDIV (or other UI item) would 'listen' in to a particular form field and notice when it changed. In his case, there was no form field included in the bind.

To get around this, he simply used ColdFusion.navigate on the DIV and switched to a URL version of his CFC:


In order for this to work the CFC has to return a string as a result, and unless the cffunction tag declares it explicitly, you will need to use a returnFormat of plain:


Thanks for sharing this, Markus.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, 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

Archived Comments

Comment 1 by Andy Sandefer posted on 5/27/2009 at 2:16 AM

Cool trick guys - thanks for posting it.

Comment 2 by Robert Haddan posted on 5/27/2009 at 6:28 PM

Similar to this post: http://www.coldfusionjedi.c...

Great tip!!!

Comment 3 by Jody Fitzpatrick posted on 6/4/2009 at 6:29 AM

I have a question, assume I have a countdown timer, and I wanted to make a function where it would automatically stop or update the count down to all users who are viewing it whether or not they refresh the page or not. I guess you can say this would be similar to and how there bidding works.

Comment 4 by Raymond Camden posted on 6/4/2009 at 3:04 PM

You would have to use an Application variable to ensure that everyone sees the same value. If you wanted the ability to stop it you would need some control for that, probably in your admin.

Comment 5 by Caleb S posted on 1/10/2013 at 11:05 PM

I haven't seen that syntax for calling CFC methods. How would you pass an argument to getCurVactid()?

Comment 6 by Raymond Camden posted on 1/11/2013 at 12:19 AM

Which syntax exactly?