Search:
Calendar:
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Subscribe:
Archives By Subject:
Adobe (33) [RSS]
AIR (7) [RSS]
Ajax (3) [RSS]
Buzzword (1) [RSS]
CFUG (42) [RSS]
ColdFusion (70) [RSS]
Flash (6) [RSS]
Flex (40) [RSS]
Frameworks (3) [RSS]
Free Software (2) [RSS]
FXUG (22) [RSS]
General (35) [RSS]
JpgMetadataReader (3) [RSS]
jQuery (1) [RSS]
Mac (2) [RSS]
Off Topic (13) [RSS]
OpenSource (14) [RSS]
PaperVision (10) [RSS]
Spry (2) [RSS]
Transfer (1) [RSS]
Tags:
Recent Entries:
Top Posts:
- [17962] Paper Vision 3D Sphere - Carousels on Steroids!
- [9921] Simple Dynamic Cursor Example in Flex2: With source code
- [9785] Simple PaperVision3D Blurring example
- [9626] PaperVision3D/Flex2 Carousel v0.2
- [9577] Simple PaperVision3D Blurring example : source code
- [9489] Saving images from Flex using ColdFusion: Simple Example with source code
- [9460] Carousel v0.2 - source code
- [9183] PaperVision Carousel0.3 - one step closer to the master plan!
- [7820] PaperVision3D is good for cubes! - a "geek" gift
- [6741] Simple Effects on a Form - Flex Example
Recent Comments:
- Getting Red from my color
David said: @Promethe: Thanks for the comment. Jason uses that way too in his example. working with number as n... [More] - Getting Red from my color
Promethe said: guys... seriously: var myColor : uint = 0xef556ef; var myRed : uint = (myColor >> 16) & ... [More] - Getting Red from my color
David said: @Jason: Thanks for the example! I never like working with numbers-to-strings-to-numbers. I'll pull y... [More] - Getting Red from my color
jason olmsted said: There is always more than one way to skin a cat. I threw together a quick class that offers easy to... [More] - Frameworks: Whats good about them, whats bad about them.
Arowolo said: I totally agree with you, and to add to your point, i think it also reduces ones understanding of th... [More]
Top Commenters:
- [8] Campbell
- [8] Ben Nadel
- [6] Steve Bryant
- [6] Mark Flewellen
- [4] barry.b
- [4] Raymond Camden
- [3] John Whish
- [3] Peter Bell
- [2] riabook
- [2] carlos
My Links:
RSS:
cfpresentation and "attributeCollection" issue
I've just been working with the new cfpresentation and cfpresentationslide tags.
These tags allow you to create dynamic, online presentations.
These tags allow you to use "attributeCollection" to pass in attributes, as do many (all?) of the tags in CF8 let you.
EG: Rather than
<cfpresentationslide title="This Slide" duration="15" ...[etc]... >
you can do this:
<cfset stAtts.title = "This Slide">
<cfset stAtts.duration = "15"
...[etc]...
<cfpresentationslide attributeCollection="#stAtts#" >
What is great about this is that you can have conditional logic when defining the attributes, and only call the tag once.
Example: Without attributeCollection
<cfif isDefined("audio")>
<cfpresentationslide title="slide one" audio="#audio#">
....[content of slide here]...
</cfpresentationslide>
<cfelse>
<cfpresentationslide title="slide one" duration="15">
....[content of slide here]...
</cfpresentationslide>
</cfif>
</cfpresentation>
With attributeCollection
<cfset stAtts = structNew()>
<cfset stAtts.title = "Slide One">
<cfif isDefined("audio")>
<cfset stAtts.audio = audio>
<cfelse>
<cfset stAtts.duration = 15>
</cfif>
<cfpresentationslide attributeCollection = "#stAtts#">
....[content of slide here]...
</cfpresentationslide>
</cfpresentation>
Now, the issue: If you are looping over a query and use attributeCollection, and in the first slide have audio, and every slide after that, have no audio, the audio from the first slide is played on every slide afterwards.
This Code produces the issue:
<cfset qThisQuery = queryNew( "title,duration,audio" )>
<!--- First row has MP3 and no duration --->
<cfset queryAddRow( qThisQuery )>
<cfset querySetCell( qThisQuery , "title" , "Slide 1")>
<cfset querySetCell( qThisQuery , "audio" , "cannedlaugh.mp3")>
<!--- Next rows have no audio, but a duration --->
<cfset queryAddRow( qThisQuery )>
<cfset querySetCell( qThisQuery , "title" , "Slide 2")>
<cfset querySetCell( qThisQuery , "duration" , "15")>
<cfset queryAddRow( qThisQuery )>
<cfset querySetCell( qThisQuery , "title" , "Slide 3")>
<cfset querySetCell( qThisQuery , "duration" , "15")>
<cfpresentation title="Example">
<cfoutput query="qThisQuery">
<!--- Create an empty struct and populate it with data for attributeColluection--->
<cfset stAtts = structNew()>
<cfset stAtts.title = qThisQuery.title>
<cfif len( qThisQuery.audio )><!--- We have a value here, so use it --->
<cfset stAtts.audio = qThisQuery.audio >
<cfelse>
<cfset stAtts.duration = qThisQuery.duration >
</cfif>
<cfpresentationslide attributeCollection="#stAtts#" >
<h1>#stAtts.title#</h1>
<p>
Here is the content of the presentation
</p>
</cfpresentationslide>
</cfoutput>
</cfpresentation>
Attached is a zip that can be put in a CF8 instance and run to see the issue happening. :-)
The main reason for this blog is so I can refer to it when I log the issue with Adobe.
[Update] As per the comment below from Rupesh, the issue is logged as bug 70594

Yes I did.
Two reasons for this entry was:
1. the area for the bug info it quite small
2. You can't attach files when logging the issue.
So I did it here and put a link to this blog in the report.
Is it normal to get an issue number if they decide it *is* a bug?
If they do, I'll add it here :-)
This is indeed a bug. I have logged bug no 70594. Thanks for bringing this to our attention.
Rupesh
Adobe ColdFusion Team
Thanks for the update :-)
Thanks for taking the time to comment.
I can't say that I did try what you suggested, but don't think it would make any difference.
As you pointed out, I am working with a new struct, do the "audio" key will not exist...
Cheers,
David