This is what I am using to get the XML
<CFOUTPUT>
var dsRecruitments = new
Spry.Data.XMLDataSet("../DisplayPages/admin/Administrators/Administrator
_#Session.AdminID#/Recruitments.xml","Recruitments/Recruitment", {
filterFunc: MyPagingFunc }, {useCache:false}); </CFOUTPUT>
function MyPagingFunc(ds, row, rowNumber) { if (rowNumber < pageOffset
|| rowNumber >= pageStop)
return null;
return row;
}
</CFOUTPUT>
Not sure what the "no cache directiive" is, I set "useCache:false"
above.
-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 17, 2007 2:46 PM
To: CF-Talk
Subject: Re: Coldfusion and Spry
Are you using the same URL for the dataset? Maybe consider adding a no
cache directive to the dataset.
On 1/17/07, Chad McCue <[EMAIL PROTECTED]> wrote:
> I created a search page that allows the admin to search for accounts
> in the database. When they first come to the search screen all
> accounts in the database are returned and presented to them. The xml
> document that SPRY reads gets generated with all accounts in the DB.
> When the admin conducts a search, I create a XML document only with
> the results returned and then overwrite the original XML document.
Works Perfectly.
> The problem is the browser after the search is conducted still sees
> all accounts even though the XML document only shows the results
> searched for. Below is some code:
>
> I am running a cf component that returns a list of accounts and puts
> it into and XML document like below.
>
> <CFQUERY>
> SELECT BLAH
> FROM BLAH
> WHERE BLAH = BLAH
> </CFQUERY>
>
> <CFXML VARIABLE="RecruitmentResults">
> <Recruitments>
> <CFOUTPUT query="Recruitments" >
> <Recruitment ID="#RecruitmentID#">
> <firstname>#htmleditformat(trim(FirstName))#</firstname>
> <lastname>#htmleditformat(trim(LastName))#</lastname>
> <company>#trim(CompanyName)#</company>
> <country>#trim(Country)#</country>
> <WantedPosition>#trim(WantedPosition)#</WantedPosition>
> </Recruitment>
> </CFOUTPUT>
> </Recruitments>
> </CFXML>
>
> <CFFILE ACTION="write"
> FILE="#Request.XMLRoute#/Administrator_#Session.AdminID#/Recruitments.
> xm l" OUTPUT="#ToString(RecruitmentResults)#"
> nameconflict="overwrite">
>
> This is the part of my result page that is outputting the results.
>
> <!--
> var pageOffset = 0;
> var pageSize = 50;
> var pageStop = pageOffset + pageSize;
>
> <CFOUTPUT>
> var dsRecruitments = new
> Spry.Data.XMLDataSet("../DisplayPages/admin/Administrators/Administrat
> or _#Session.AdminID#/Recruitments.xml","Recruitments/Recruitment", {
> filterFunc: MyPagingFunc }, {useCache:false}); </CFOUTPUT>
>
> function MyPagingFunc(ds, row, rowNumber) { if (rowNumber <
> pageOffset || rowNumber >= pageStop)
> return null;
> return row;
> }
>
> function UpdatePage(offset)
> {
> var numRows = dsRecruitments.getUnfilteredData().length;
>
> if (offset > (numRows - pageSize))
> offset = numRows - pageSize;
> if (offset < 0)
> offset = 0;
>
> pageOffset = offset;
> pageStop = offset + pageSize;
>
> // Re-apply our non-destructive filter on dsStates1:
> dsRecruitments.filter(MyPagingFunc);
>
> }
> -->
> </script>
>
> <div id="Recruitment_Div" spry:region="dsRecruitments">
> <table id="Recruitment_Table" class="datagrid" width="100%"
> border="0" cellspacing="0" cellpadding="0">
> <tr class="FormBar">
> <th onclick="dsRecruitments.sort('lastname','toggle');"
> align="left" class="LeftBorder" style="cursor:pointer"> Contact
> Name</th>
> <th onclick="dsRecruitments.sort('company','toggle');"
> width="350" align="left" style="cursor:pointer">Company Name</th>
> </tr>
> <tbody>
> <tr bgcolor="#Request.Row1Color#" spry:repeat="dsRecruitments"
> class="FormBody2">
> <td width="125" align="left" valign="middle"
class="LeftBorder">
> {firstname} {lastname}
> </td>
> <td width="350" valign="middle">
> {company}
> </td>
> </tr>
> </tbody>
> </table>
> </div>
>
>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266806
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4