3 Replies Latest reply on Apr 16, 2007 3:00 PM by craigkaminsky

    Automatically Refresh Pages

    Torgom
      Hi,

      I need to write a small app. that gets the data from the DB then displays first 10 records, then the page automatically refreshes displaying the next 10 records and so on.

      How can i do it. I just need the concept.

      Thanks
        • 1. Re: Automatically Refresh Pages
          Level 7
          How can i do it. I just need the concept.

          Several ways, but one of the oldest and simplest ways would be a
          'meta-refresh' tag that reloaded the page every x seconds, passing a url
          value of what the next record set should be.
          • 2. Re: Automatically Refresh Pages
            craigkaminsky Level 3
            One way to approach it (and this may very well not be the best...or even an ideal way to do it), is to dynamically generate a META tag in your head section for refresh.

            Something like:
            <cfparam name="URL.startRow" type="numeric" default="1"/>
            <cfif URL.startRow GT 1>
            <cfset startRow = startRow + 10/>
            </cfif>
            <cfoutput>
            <meta http-equiv="refresh" content="10; url=http://www.yoururl.com/yourpage.cfm?startRow=#startRow#" />
            </cfoutput>
            <cfquery.../>
            ...content output

            Again, this is probably not ideal but might get you going in the direction you wish.

            Hope it helps.
            • 3. Re: Automatically Refresh Pages
              craigkaminsky Level 3
              Sorry, the cfset tag should be:
              <cfset URL.startRow = URL.startRow + 10/>

              was typing fast and forgot to scope it!