1

I'm new to ColdFusion. I'm having a problem with coldfusion components. I have a functionality where i call cfcomponent function through jquery ajax call, and in the cffunction i'm executing a query and sending resulted html in string format as response.

Everything is working fine but for some reason i'm not getting latest records from database, i tried cachedwithin = "0" in cfquery tag but no luck. Can someone explain why this kind of behavior from cfcomponents? My guess is caching.

Edit:

Issue Has been resolved, Thanks everyone for your response. The issue is we used space in cfqueryparam value like below.

<cfqueryparam list="yes" separator="," cfsqltype="CF_SQL_VARCHAR" value="A, B, C, D">

I think it should be like this,

<cfqueryparam list="yes" separator="," cfsqltype="CF_SQL_VARCHAR" value="A,B,C,D">

that made query to exclude some of results, beacuse cfqueryparam included space when it converted list to varchar's

  • Are you using Firebug? Can you see what the response is from the server? Is it different from what is displaying on the page? – Evik James Aug 14 '12 at 14:30
  • ColdFusion does not (in most cases) trim spaces from comma-space separated lists. When dealing with lists, its best to leave the spaces out to avoid unexpected behaviours – Mike Causer Aug 15 '12 at 02:09

1 Answers1

3

Make sure you prevent the ajax results from being cached.

$.ajaxSetup ({
    // Disable caching of AJAX responses
    cache: false
});

from: Stop jQuery .load response from being cached

Community
  • 1
  • 1
genericHCU
  • 4,394
  • 2
  • 22
  • 34