Posted in ColdFusion | Posted on 07-23-2009 | 4,054 views
I got my forums back up and in the process of doing so - found two interesting issues.
First - Image.cfc (which is from the open source ImageCFC project) made use of a CFC method called Throw. This allowed code in the CFC to do:
Unfortunately this conflicts with ColdFusion 9's built in support for throwing via script. My "fix" was to simply rename all the throw calls to xc989082903480983894840894328093289042389. Now the code does:
Ok... I lie. I just renamed it mythrow, and updated the method definition as well.
Now for the UI issue. The ColdFusion/General forum has a ginormous number of threads. This created the following "interesting" UI:
That's awesome, isn't it? All it needs is a unicorn or two to spruce it up.
So I thought that wouldn't fly. What I ended up doing is simply adding some logic to say - if there are so many pages, switch to a drop down:
2 <cfif attributes.pages gt 10>
3 <select onChange="document.location.href=this.options[this.selectedIndex].value">
4 <cfloop index="x" from=1 to="#attributes.pages#">
5 <option value="#cgi.script_name#?#qs#&page=#x#" <cfif url.page is x>selected</cfif>>Page #x#</option>
6 </cfloop>
7 </select>
8 <cfelse>
9 <cfloop index="x" from=1 to="#attributes.pages#">
10 <cfif url.page is not x><a href="#cgi.script_name#?#qs#&page=#x#">#x#</a><cfelse>#x#</cfif>
11 </cfloop>
12 </cfif>
13</p>
Which results in:
Somewhat better I think. Full City Media, who did the original skin for Galleon 2, is sending me over a small CSS tweak for it that I'll include in the new version shipping tomorrow morning.


You'd think Adobe would have the decency to check with everyone first!
NEW FOR COLDFUSION 10: xc989082903480983894840894328093289042389()
D'oh!
http://www.dopefly.com/projects/pagination/
Here are some live examples:
http://www.dopefly.com/projects/pagination/examples/" target="_blank">http://www.dopefly.com/projects/pagination/example...
[Add Comment] [Subscribe to Comments]