This should have everything you need. When I use the CFC the page just
runs and never loads. I end up with a error because it exceeded the time
limit. When I switch to a cfm page it loads instantly.

 
Here are my conclusions and hopefully someone can figure this out for
me. Is there anything special I have to do server side to be able to
call a cfc?

When I do this
<script type="text/javascript">

var XML_URL =
"../FunctionPages/Employers.cfc?method=GetEmployerResults";

//create a basic Spry DataSet
var dsEmployers = new Spry.Data.XMLDataSet(XML_URL, "dataset/row", {
useCache: false });

//create a page-enabled view of the Spry DataSet var pvEmployers = new
Spry.Data.PagedView(dsEmployers, { pageSize: 12 });

</script>

I get a coldfusion time out error and the spry does not load the data.


Here is my CFC
<CFFUNCTION name="GetEmployerResults" access="remote" returntype="void"
output="false">
        <CFARGUMENT name="EmployerName" default="" />

                        
        <CFQUERY datasource="#request.dsource#" name="EmployerQry">
        SELECT rtrim(FirstName) as FirstName, rtrim(LastName) as
LastName, rtrim(EmailAddress) as EmailAddress
                FROM AMP_Employers
        WHERE EmployerID > 0
        </CFQUERY>
                
         <cfset toXML = createObject("component", "toXML")>

         <cfset EmployerXML = toXML.queryToXML(EmployerQry, "dataset",
"row")>           
         <cfset parsedEmployerXML = xmlParse(EmployerXML) >

                  
         <cfcontent type="application/xml; charset=UTF-8">

         <cfreturn parsedEmployerXML >   
                                
                                        
</CFFUNCTION>


When I do this below (switch the cfc page to a cfm page) it runs
perfectly.

<script type="text/javascript">

var XML_URL = "../FunctionPages/Employers.cfm";

//create a basic Spry DataSet
var dsEmployers = new Spry.Data.XMLDataSet(XML_URL, "dataset/row", {
useCache: false });

//create a page-enabled view of the Spry DataSet var pvEmployers = new
Spry.Data.PagedView(dsEmployers, { pageSize: 12 });

</script>


Here is my cfm file

<CFQUERY datasource="#request.dsource#" name="EmployerQry"> SELECT
rtrim(FirstName) as FirstName, rtrim(LastName) as LastName,
rtrim(EmailAddress) as EmailAddress
FROM AMP_Employers
WHERE EmployerID > 0
</CFQUERY>
                
<cfset toXML = createObject("component", "toXML")>                
<cfset EmployerXML = toXML.queryToXML(EmployerQry, "dataset", "row")>

<cfset parsedEmployerXML = xmlParse(EmployerXML) >

<cfcontent type="application/xml; charset=UTF-8">                 
<CFOUTPUT>#parsedEmployerXML#</CFOUTPUT>                  
-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 12, 2007 3:10 PM
To: CF-Talk
Subject: Re: Using Spry to Page forward and backward through data

So are you loading the string in as is or calling it via a url in the
dataset? Show me your JS please.


On 4/12/07, Chad McCue <[EMAIL PROTECTED]> wrote:
> I am using CF7
>
>
> Chad McCue
> Advanced Media Productions
> 251 West Central St. Suite 28
> Natick MA, 01760
>
> p: 508.647.5151 ext 16
> f: 508.647.5150
>
> -----Original Message-----
> From: Raymond Camden [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 12, 2007 2:50 PM
> To: CF-Talk
> Subject: Re: Using Spry to Page forward and backward through data
>
> Are you using CF7? Only CF7 supports the "Dont wddx encoded a result 
> if returntype is xml". If you aren't using 7, you will need to use a 
> proxy CFM file.
>
> On 4/12/07, Chad McCue <[EMAIL PROTECTED]> wrote:
> > I think I am closer but still am lost. This is what is coming back 
> > to my result page and populating spry. I not sure why this is 
> > returning like this and not keeping the formatting.
> >
> >                   <wddxPacket
> > version='1.0'><header/><data><string>&lt;?xml version="1.0"
> > encoding="UTF-8"?&gt;<char
> >
> --
> ======================================================================
> ==
> ===
> Raymond Camden
>
> Email    : [EMAIL PROTECTED]
> Blog      : ray.camdenfamily.com
> AOL IM : cfjedimaster
>
> Video game player? Have kids? Check out KidGamers.org
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275098
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to