Skip to main content
Participant
February 16, 2010
Question

refreshing a spry xml file from mysql

  • February 16, 2010
  • 1 reply
  • 966 views

hello. i am trying to get a dynamic region on a page to refresh from a mysql query. and, get the query to run periodically against the database to check for changes while the user is on the page.

based on searches and reading these two links:

http://labs.adobe.com/technologies/spry/articles/data_set_overview/

http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

i think i understand how to:

1. create the javascript object

2. bind it to an xml file on the server side

3. create the dynamic region on the html page

4. create an initial xml file with the results of the mysql query to the database

5. force the js object to refresh its view of the xml file from the server periodically

what i can't seem to get to is how to get the xml file itself to keep getting refreshed by re-querying the database to see what has changed in the table every n seconds. do you know how?

thanks in advance.

This topic has been closed for replies.

1 reply

_V11
Participating Frequently
February 16, 2010

The Spry dataset constructor allows you to specify various of options. One of these options is loadInterval. See API documentation for more information: http://labs.adobe.com/technologies/spry/articles/data_api/apis/dataset.html#constructor

Participant
February 17, 2010

Arnout - thanks, i'm with you on that piece. but let me check whether i understand it right. changing the load interval exclusively affects the link between my browser and the xml file on the server, correct?

if yes, got that part.

i'm stuck on how do i force my xml file itself to be refreshed with the latest contents from the mysql database?

thanks for any pointers,

jk

David_Powers
Inspiring
February 18, 2010

If you are using the solution on http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html, there is no XML file. It queries the database directly every time the page is accessed, and generates the XML dynamically.