Solved

Is it possible to refresh page and show remainder of recodset?

Posted on 2003-12-09
19
258 Views
Last Modified: 2013-12-24
I am using the below code to show 45 records in a dual column, the page will refresh every 30 secs.  how ever I would like it to show on the refresh the remainder of the records if they are GT 45 until it hits the final record then it can start again from 1-45?

any insight would be great.
(in case you want to know it will be for a message center that will display all messages received on a screen so people can come pick it up)



code is as follows:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="30">
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>
</head>

<body>
<cfset numberOfRecordsBeforeHeaderDisplay = 45>
<cfset pageBreakCounter = 0>


<cfset numberofrecords = "#get_mess.recordcount#">
<Cfset TotalPages =  numberofrecords/numberOfRecordsBeforeHeaderDisplay >

<cfset page =1>



<cfoutput query="get_mess">
<!--- Display header --->

<cfif get_mess.currentRow mod numberOfRecordsBeforeHeaderDisplay EQ 1>
 <cfif pageBreakCounter eq 0>
    <!-- start newspaper table -->

 
 
    <div align="center">
      <em><strong>MESSAGE CENTER</strong></em>
      </div>
    <table width="100%" cellpadding="0" cellspacing="0">
   
      <tr>
 </cfif>
 <cfset pageBreakCounter = IncrementValue(pageBreakCounter)>
  <td width="5%">
        <table width="100%" height="90%" cellpadding="0" cellspacing="0">
          <tr>
            <td width="81%" valign="top" align="left">Name</td>
           
           <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          </tr>
          <td> </cfif>
          <!--- table cell display --->
          <tr> <font face="Arial, Helvetica, sans-serif" size="2">
            <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#</td>
           
         
            </font>
          <!--- Display close table --->
          <td> <cfif get_mess.currentRow mod numberOfRecordsBeforeHeaderDisplay EQ 0 OR get_mess.currentRow EQ get_mess.recordCount>
        </table>
  </td>
    <cfif pageBreakCounter mod 2 eq 0 OR get_mess.currentRow EQ get_mess.recordCount>
      <cfset pageBreakCounter = 0>
      <!--- close newspaper table --->
  </table>
      <br class="pageBreak">
        <cfset Page=Page+1>
    </cfif>
</cfif>
</cfoutput>

</body>
</html>
0
Comment
Question by:jriver12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 3
  • +1
19 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9907405

do query



<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+50>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">

<cfouptput query="" startrow="iStarRow" maxrows="50">
0
 

Author Comment

by:jriver12
ID: 9907667
the refresh portion works unfortunately I keeps returning the same record set.

<!--- get the messages --->
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+45>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">



<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9907726
do you have the met tag between cfoutput tags?

<cfoutput>
   <meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">
</cfoutput>
0
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 

Author Comment

by:jriver12
ID: 9907883
this is what I have done with no luck.
<!--- get the messages --->
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+5>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<cfoutput><meta http-equiv="Refresh" content="5;URLpage.cfm?start=#iStartRow#"><cfoutput>



<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>

0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9907890
this line

<cfif iStartRow gt query.recordCount>

should be

<cfif iStartRow gt get_mess.recordCount>
 i put the query.recordcount as a spacer

ok try this

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9907910
left a line out


<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
 

Author Comment

by:jriver12
ID: 9907937
still receiving the same recordset.

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="5;URLpage.cfm?start=#evaluate('#iStartRow#'+10)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9908048
sorry typo

try this as teh meta tag

<meta http-equiv="Refresh" content="30;url=URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9910054
I guess using CFFLUSH wld help here

read help on it & try it out !
0
 
LVL 11

Expert Comment

by:hart
ID: 9910255
ok how about this

<cfparam default="1" name="iStartRow">

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif iStartRow gte get_mess.RecordCount>
  <cfset iStartRow = 1>
</cfif>

<HTML>
<HEAD>
<meta http-equiv="Refresh" content="30;url=pagename.cfm?iStartRow =<cfoutput>#evaluate(iStartRow+45)#</cfoutput>">
</HEAD>
<BODY>
<table>
<tr>
<td> Messages have been rececived for the following</td>
</tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
<td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
</td>
</tr>
</cfoutput>
</table>
</BODY>
</HTML>


let me know

Regards
Hart
0
 
LVL 11

Expert Comment

by:hart
ID: 9910259
there will be space in between iStartRow =<cfoutput>#
kindly remove it and make it to iStartRow=<cfoutput>#
in the meta tag

Regards
Hart
0
 
LVL 25

Accepted Solution

by:
James Rodgers earned 500 total points
ID: 9911931
here is the complete code bu tin the meta tag you really should have a value greater that 5, that value is the number of seconds until the page refreshes, go with 30 or at least 20

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="5;url=URLpage.cfm?start=#evaluate('#iStartRow#'+10)#">
</cfoutput>

<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>

</table>
0
 

Author Comment

by:jriver12
ID: 9911961
Jester_48
Thanks for the insight on the meta time I had set it to 5 because I did not want to wait during testing.  However the last correction on the meta worked flawlessly. thanks for the assistance and time with this code.
0
 

Author Comment

by:jriver12
ID: 9911971
Thanks to all to have participated in this thread your assistance is and always will be greatly appreciated.

Thanks again.
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9911987
np...
glad i could help

i apologize for the typos, can't type worth a damn, kind of a bad thing for someone in my job

;-)
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9911991
thanks for the points
0
 

Author Comment

by:jriver12
ID: 9912018
I Feel You Pain.

And your welcome, would have offered more but EE limits me.

;^0
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9912046
>>would have offered more but EE limits me
thanks
but ,hey... no worries
0
 
LVL 11

Expert Comment

by:hart
ID: 9918053
did u even try my post it was more simplified ???

Regards
Hart
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question