HOME STORE APPLICATIONS COLDFUSION PHP PORTFOLIO PROFILE CONTACT
Maps: TEXT|HTML|XML|RSS

Freelance Web Developer. ColdFusion, PHP, ASP.net programming worldwide

support@cf-works.com. SMS: +7-911-715-57-84

PrevNext: Coldfusion function splitting output content into pages (Item ID:147)

coldfusion function examples,coldfusion open source,coldfusion code examples, 
splitting search results,splitting query results,paging search results,coldfusion examples, split output
Enlarge image: PrevNext: Coldfusion function splitting output content into pagesEnlarge Image
Type:SOFTWARE (downloadable)
Category: Coldfusion Open Source 
Developer:CF-Works   [more items by CF-Works]
Seller:CF-Works   [more items from CF-Works]
Price:$5.00
Availability:Downloadable Immediately
Popularity: RateRateRateRateRate
 
  Status:  
Ready

With my PrevNext fuction it is possible to do search results paging real easily. It is used everywhere within this site and in all of my clients' sites. The only requirement is: the name of the query supposed to be splitted should be "Results". Of course it was possible to setup it also as argument but this is unnecessary and not good for code readability.

It accepts several arguments allowing to display paging flexible. To use PrevNext you will need second minor function though named PrevNextInc though, but that's all.

So sample piece of code using PrevNext function would look like this:

  <CFSILENT>
<CFLOCK scope="SESSION" type="READONLY" timeout="10">
<CFIF not isdefined("SESSION.results.recordcount")>
<CFSET needsrequery=1>
</CFIF>
</CFLOCK>
<CFIF isdefined("needsrequery")>
<CFQUERY name="results" datasource="#REQUEST.ds#">
select * from schedule order by schedule
</CFQUERY>
<CFLOCK scope="SESSION" type="EXCLUSIVE" timeout="20">
<CFSET SESSION.results=results>
</CFLOCK>
</CFIF>
<CFSCRIPT>
obj=createObject("component","#REQUEST.cfcpath#Globals");
sr=obj.prevNextInc();
</CFSCRIPT>
</CFSILENT>
<CFINCLUDE template="header.cfm">
<CFSCRIPT>obj.prevnext(0,sr);</CFSCRIPT>
<TABLE border="0">
<CFOUTPUT query="Results" startrow="#sr#" maxrows="#REQUEST.maxrows#">
<TR <cfif results.currentrow Mod 2>class="trshade"</cfif>>
<TD class="results">#dateformat(datescheduled,"mm/dd/yyyy")#</TD>
<TD class="results">#phase#</A></TD>
<TD class="results">#dateformat(datecompleted,"mm/dd/yyyy")#</TD>
</TR>
</CFOUTPUT>
</TABLE>
<CFSCRIPT>obj.prevnext(0,sr);</CFSCRIPT>
<CFINCLUDE template="footer.cfm">

(replace REQUEST.cfcpath, queried table ("Schedule"), header.cfm and footer.cfm with your values in the code above)

 
BRIEF DESCRIPTION: CF-Works: coldfusion function examples, coldfusion open source, coldfusion code examples, splitting search results, splitting query results, paging, coldfusion examples, split output into pages

 
write review Add your review to this item:
Existing customers please login (click "Your Account" top menu item).
New customers choose Quick Registration including just your name, email and password or Complete Registration


*Ask a Question about PrevNext: Coldfusion function splitting output content into pages:
E-Mail:enter your email address if you would like to be notified when your question is answered
*Anti-spam code:
Please enter anti-spam code to prevent automated scripts' spam submissions. Thank You

  Status:  
Ready


Reviews Rate: Not Rated
Visitors Rate: RateRateRateRateRate   (9 votes)
Rate this item:
 Rate PrevNext: Coldfusion function splitting output content into pages: CF-Works: coldfusion function examples, coldfusion open source, coldfusion code examples, splitting search results, splitting query results, paging, coldfusion examples, split output into pages