Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
so if i access the page once, and remain on that page for say an hour, and the database records are changing, it doesn't look like my results will get refreshed as the database changes. am i reading that code correctly? that's what i'm after, getting the table on my page to refresh itself periodically to show the latest snapshot of the table but without having to click the browser's refresh button. will the setup in that link do this?
Copy link to clipboard
Copied
Arnout can tell you how the Spry end of it works. The point about the XML is that no physical file is created. Each time the URL is requested, a query is sent to MySQL, and the XML output reflects the current state of the database.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more