Login
Latest Code Ticker for ColdFusion
|
Daily Code Email
|
|
|
|
| | Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | New ColdFusion 5.0 Feature Highlights
by Herbert L. Riede
Programmer, WinDough.com, Inc.
This article was updated May 6th with an updated UDF demo for cross-browser compatibility
CFFLUSH
This new tag enables you to "Flush" what a ColdFusion page has generated so far to the browser. Currently, HTML Output is not sent to the visitor's browser until the entire page has been processed. This tag enables you to output the top of the page or a small "Page Loading" message while the rest is processed. You _cannot_ use any tags that alter the HTTP header once you Flush.. It will throw a CFError. No CFLocation's after a Flush!!
Link to Allaire's (-ahem- Macromedia's) Description
Query of Queries
This new feature enables you to run a query on a recordset already returned from a query, without hitting the database again. It can also be used to perform SQL queries against <CFDIRECTORY> listings, as well as on information returned by other tags as a recordset.
Link to Allaire's (-ahem- Macromedia's) Description
User Defined Functions (UDFs)
This is a new CFScript feature (but you can use the functions you write in cftags or #function(var)# formats)
A simple demonstration would be a function that creates roll-over code for you:
<cfoutput>
#RollOver("MyImg", "myimg.gif", "myrollover.gif",
"http://mysite.com")#
</cfoutput>
<cfscript>
function RollOver( name, img, imgover) {
HTMLOut = "<a href='";
if (ArrayLen(Arguments) eq 4) {
HTMLOut = "#HTMLOut##Arguments[4]#'";
} else {
HTMLOut = "#HTMLOut####name#' name='#name#'";
}
HTMLOut = "#HTMLOut# onmouseover='#name#.src = ""#imgover#"";' onmouseout='#name#.src = ""#img#"";'><img src='#img#' name='#name#' border=0></a>";
return HTMLOut;
}
</cfscript>
This works in CF5 and outputs:
<a href='http://mysite.com' onmouseover='MyImg.src = "myrollover.gif";' onmouseout='MyImg.src = "myimg.gif";'><img src='myimg.gif'
name='MyImg' border=0></a>
Note I only declared 3 arguments in RollOver. This enables you to call it with only 3 arguments for No-Link Rollovers. The fourth argument, if it exists, is the URL to link to. IF I HAD DECLARED ALL FOUR, ALL FOUR WOULD HAVE BEEN REQUIRED.. So this is an example of optional arguments as well..
Also note that I COULD do this with a custom tag, but a collection of these short functions all in one file could be a POWERFUL include file.. Include a function library in your application.cfm and you will have built your own language extensions!
Link to Allaire's (-ahem- Macromedia's) Description
CFSAVECONTENT
This new tag takes ColdFusion to a whole new level. Just wrap CFSaveContent around, well, anything and do anything with it. Similar to having a custom tag process "ThisTag.GeneratedContent" (If you don't know what I'm talking about, don't worry), but this "offers significant performance improvements over custom tag solutions." (MacroMedia ColdFusion 5 Beta Site)
Link to Allaire's (-ahem- Macromedia's) Description
CFGRAPH
A new Multimedia tag, CFGRAPH outputs GIF, JPG, and FLASH graphs and charts - in Pie, Line, and Bar format. There is SO MUCH ABOUT THIS TAG, You need to visit their site to learn all about it!
Link to Allaire's (-ahem- Macromedia's) Description
I plan on writing CF5 Function Libraries, Graph examples and more in the near future. I think these New Features will have me working late to take advantadge of all the new possibilities.
I invite your comments, and any questions you may have. If this tutorial was valuable to you, please vote!
| | Other 3 submission(s) by this author
| | | Report Bad Submission | | | Your Vote! | | | Other User Comments | 5/1/2001 2:43:17 AM:[C][F][5][0] Hi, I never worked with this
product.
I worked with and know how to
use
html/cgi/asp/sql/html/dhtml/javascript/f
lash but never did anything with
ColdFusion. Can you please tell me what
is does? Any Help At All will be Very
Helpfull.
I know it has to do
something about websites for
webmasters! :-)
Do you have any
information for newbies like my-self
that can help me learn this Lang. ?
Again, Thanks For Any Help.
(Note:
Please, Email me with any info. if
possible. I don't come here often. So,
I don't come back to the pages I
visited. [Thx.])
----------
Thanks
For Supporting Open
Source.
----------
| | Add Your Feedback! | Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. | | |
|