Hi All,

My AJAX calls are getting killed (post is fine, but response is messed
up) in OpenBD when I use CFSAVECONTENT.

The same code executes with no issues on CF 8.

I've tracked it down to the difference in what CFSAVECONTENT returns
as it's specified variable.

Here is the code I'm testing:
--------------------------------------------------------------
  <cffunction name="pkgTestForm" returnType="struct" access="public">

    <!--- var vars--->
    <cfset var retStruct = StructNew()>
    <cfset var output = "">

    <!--- simple cfsavecontent test - yes I know I don't need the
output tags for this test--->
    <cfoutput>
      <cfsavecontent variable="output">
        A few simple words
      </cfsavecontent>
    </cfoutput>

    <!--- add to structure --->
    <cfset structInsert(retStruct, "success", "1")>
    <cfset structInsert(retStruct, "output", output)>
    <cfset structInsert(retStruct, "exception", "")>

    <cfreturn retStruct>

  </cffunction>
--------------------------------------------------------------

RESULTING STRING IN CF 8 (note the whitespace):
<string>              <char code='0d'/><char code='0a'/>        A few
simple words<char code='0d'/><char code='0a'/>      </string>

RESULTING STRING IN OpenBD (note the lack of whitespace):
<string> <char code='0d'/><char code='0a'/> A few simple words<char
code='0d'/><char code='0a'/> </string>

I have no idea why whitespace would be an issue here.

Here is the central ajaxCall cffunction I pass all ajaxCalls through
(well the important bits you'll need to see)....it returns a string
BTW.  If I return "content" without the serialize JSON function around
it and change the returntype to a struct, the code returns as it
should in CF 8 and I get an internal server error in OpenBD:
----------------------------------------------------------------
    <cfinvoke method="#ARGUMENTS.method#"
              component="#REQUEST.cfcMapping#.#ARGUMENTS.component#"
              returnvariable="content"
              argumentcollection="#ARGUMENTS#">
    </cfinvoke>

    <cfset x = StructInsert(content, "callback", ARGUMENTS.callback)>

    <!--- serialize the returned structure --->
    <cfreturn serializeJSON(content,false,true)>
----------------------------------------------------------------

Of course the serializeJSON function is different in CF8 and OpenBD.
The code above is what I use for OpenBD, the CF 8 version is <cfreturn
serializeJSON(content,false)> (the 3rd arg for forcing lowercase
doesn't exist in CF 8).

FYI...Ajax calls that don't involve CFSAVECONTENT work just fine on
both app servers.

Any help greatly appreciated!!

TIA

Cheers
--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to