Why are you saying you have to write it out to an XML file? Are you saying
that calling the CFC fails from Spry? But you can browser it and it works,
so you save that file as XML and then call that from spry? If so, then I
wonder if the problem is simply that what you're sending to the browser
(that works) has stuff in it that spry itself would not like (must be pure
XML). A common mistake is to leave debugging turned on. You don't "notice
it" in the browser (your eyes have learned to accept it), but the spry
xmlhttprequest (or any ajax request) will balk if it's not just XML. There
can also be problems due to the content type being still set as HTML (as
CFML pages are by default) or whitespace issues. 

I've discussed these very challenges and their solution in a blog entry a
few weeks ago:

I-Spry Part 4: Help. Spry/Ajax isn't working: problems due to unexpected
server results
http://carehart.org/blog/client/index.cfm/2006/7/13/spry4_unexpected_server_
results

Here's one that's got some other easy spry mistakes:

I-Spry Part 3: Some easy mistakes (I hope you will now avoid)
http://carehart.org/blog/client/index.cfm/2006/7/11/spry_gotchas

Finally, as for your wanting to submit data via Spry, check out Ray's entry:

Sending Data with Spry
http://ray.camdenfamily.com/index.cfm/2006/7/12/Sending-Data-with-Spry

Let us know if any of those help you.

/charlie
http://www.carehart.org/blog/

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, August 24, 2006 1:19 PM
To: [email protected]
Subject: Re: [ACFUG Discuss] Feeling a little SPRY

essentially:

setup:
cfmx7
everything is local.

Calling page is Here:
<code_snippet source="john">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test</title> <script language="JavaScript" type="text/javascript"
src="includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript"
src="includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript">
        //var cartData = new
Spry.Data.XMLDataSet("com/cart.cfc?method=getcarts",
"/query/row");
//have have the cfc write out an xml file cause it wont read the above line
var cartData = new Spry.Data.XMLDataSet("myxml.xml", "/query/row");
</script> <link rel="stylesheet" type="text/css" href="armc.css" /> </head>
<body> <div id="container">
  <div id="top">Chart Cart v0.1Alpha</div>
     <div spry:region="cartData" id="content">
      <table border="1">
        <tr>
          <th onClick="cartData.sort('cartid','toggle');">Cart Number</th>
          <th onClick="cartData.sort('username','toggle');">Current
User</th>
          <th onClick="cartData.sort('department','toggle');">Users
Department</th>
          <th onClick="cartData.sort('authusername','toggle');">Authorized
by</th>
          <th onClick="cartData.sort('statusid','toggle');">Cart Status</th>
          <th onClick="cartData.sort('ticketid','toggle');">Cart Repair
Ticket</th>
        </tr>
        <tr spry:repeat="cartData"
onClick="cartData.setCurrentRow('{ds_RowID}');">
          <td>{cartid}</td>
          <td>{username}</td>
          <td>{department}</td>
          <td>{authusername}</td>
          <td><span spry:if="'{statusid}' == 1;">
            <center>
              {cartstatusdescr} <br />
              <img src="images/avail.jpg" height="20" width="20">
            </center>
            </span> <span spry:if="'{statusid}' != 1;">
            <center>
              {cartstatusdescr} <br />
              <img src="images/notavail.jpg" height="20" width="20">
            </center>
            </span> </td>
          <td><span spry:if="'{ticketid}' != 0;">
            <center>
              <img src="images/submitimg.gif" height="20" width="20">
            </center>
            </span> <span spry:if="'{ticketid}' == 0;">
            <center>
              <img src="images/ticket.gif" height="20" width="20">
            </center>
            </span> </td>
        </tr>
      </table>
    </div>
    <div id="moreinfo" spry:detailregion="cartData">
                <div id="cartinfo">
          Last Date Checked Out:{checkout} <br />
      Last Date Check In:{checkin} <br />
      Notes: {notes} <br />
          </div>
          <div id="carttools">
          <a href="##">Check In Cart {cartid}</a><br />
          <a href="##">Check Out Cart {cartid}</a> <br />
          <a href="##">Remove Cart {cartid}</a><br />
          <a href="##">Add new Cart</a>
          </div>
    </div>

  <div id="footer">blargh</div>
</div>
</body>
</html>

</code_snippet>


And the xml the cfc returns is here (though i have to have it write out to
myxml.xml for spry page to work):
<code_snippet source="johnscfc">
<?xml version="1.0" encoding="UTF-8" ?>
<query columns="10" rows="3">
  <row>
    <authusername>MARK FENNELL</authusername>
    <cartid>10</cartid>
    <cartstatusdescr>Checked In</cartstatusdescr>
    <checkin>August 22, 2006</checkin>
    <checkout>August 22, 2006</checkout>
    <department>Data Processing (936)</department>
    <notes>I have sung the songs of the exalted salted almonds</notes>
    <statusid>1</statusid>
    <ticketid>0</ticketid>
    <username>JOHN LYONS</username>
  </row>
  <row>
    <authusername>JOHN LYONS</authusername>
    <cartid>11</cartid>
    <cartstatusdescr>Checked In</cartstatusdescr>
    <checkin>August 22, 2006</checkin>
    <checkout>August 22, 2006</checkout>
    <department>Data Processing (936)</department>
    <notes>Can't Sleep Clowns will eat me</notes>
    <statusid>1</statusid>
    <ticketid>0</ticketid>
    <username>JOHN LYONS</username>
  </row>
  <row>
    <authusername>JOHN LYONS</authusername>
    <cartid>12</cartid>
    <cartstatusdescr>Checked In</cartstatusdescr>
    <checkin>August 22, 2006</checkin>
    <checkout>August 22, 2006</checkout>
    <department>Data Processing (936)</department>
    <notes>The cat ate his hat while dancing on a boy named matt</notes>
    <statusid>1</statusid>
    <ticketid>0</ticketid>
    <username>JOHN LYONS</username>
  </row>
</query>

</code_snippet)


I really need to do 2 things:
1) be able to call that cfc without having it write out the myxml file
because the file and what shows in the browser are identical

2)be able to send to a webservice with arguements so i can alter carts
states via the links at the bottom.




-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists Archive @
http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to