Skip to main content
Known Participant
August 28, 2008
Question

Navigation

  • August 28, 2008
  • 1 reply
  • 348 views
I try to create the navigation and I alomost got there. There is one problem that when i click the
"next" go to page2, I got the repeated record from the last record was show on page1. Then I click "next" go to page3 then it worked fine, no repeating record. Why it is only happend on page 2 and what should i do?


<cfparam name="PageNum_RecordReturn" default="1">
<cfset maxrows_recordreturn=2>
<cfparam name="PageNum_RecordReturn" default="1">
<cfset startrow_recordreturn=min((pagenum_recordreturn-1)*maxrows_recordreturn+1,max(counter,1))>
<cfset endrow_recordreturn=min(startrow_recordreturn+maxrows_recordreturn-1, counter)>
<cfset totalpages_recordreturn=ceiling(counter/maxrows_recordreturn)>
<cfset querystring_recordreturn=iif(cgi.query_string neq "",de("&"&cgi.query_string),de(""))>
<cfset temppos=listcontainsnocase(querystring_recordreturn,"PageNum_RecordReturn=","&")>
<cfif temppos neq 0>
<cfset querystring_recordreturn=listdeleteat(querystring_recordreturn,temppos,"&")>
</cfif>


<cfoutput>
<tr>
<td width="15%"><cfif pagenum_recordreturn gt 1><a href="#CurrentPage#?PageNum_RecordReturn=1" class="bold">first</a></cfif><img src="../images/1x1clear.gif" width="1" height="1" border="0" alt=" "></td>
<td width="15%"><cfif pagenum_recordreturn gt 1><a href="#CurrentPage#?PageNum_RecordReturn=#Max(DecrementValue(PageNum_RecordReturn),1)#" class="bold">previous</a></cfif><img src="../images/1x1clear.gif" width="1" height="1" border="0" alt=" "></td>
<td width="40%" class="c"><b>Records #StartRow_RecordReturn# to #EndRow_RecordReturn# of</b> <strong>#RecordReturn.RecordCount#</strong></td>
<td width="15%" class="r"><cfif pagenum_recordreturn lt totalpages_recordreturn><a href="#CurrentPage#?PageNum_RecordReturn=#Min(IncrementValue(PageNum_RecordReturn),TotalPages_RecordReturn)#" class="bold">next</a></cfif><img src="../images/1x1clear.gif" width="1" height="1" border="0" alt=" "></td>
<td width="15%" class="r"><cfif pagenum_recordreturn lt totalpages_recordreturn><a href="#CurrentPage#?PageNum_RecordReturn=#TotalPages_RecordReturn#" class="bold">last</a></cfif><img src="../images/1x1clear.gif" width="1" height="1" border="0" alt=" "></td>
</tr>
</cfoutput>

Thanks
This topic has been closed for replies.

1 reply

Inspiring
August 29, 2008
who knows! where's your code?
(hint: post relevant code snippets when asking question like 'why
doesn't this code of mine work like this')

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/