Category: ColdFusion

Bug in CFMX7 XSL and CFSELECT

I've been playing around with the XSL forms in Coldfusion MX 7 and ran into a bug yesterday. If I have a multiple select, then the XSL style sheets don't properly mark each selected value as such. Let's say I have this code:

<cfselect 
	name="PhaseIDs" 
	label="Assigned Phases: " 
	query="rsPhaseList"
	value="PhaseID"
	display="PhaseName"
	selected="#Book.getPhaseIDs()#"
	size="10" 
	multiple="yes"
></cfselect>

I would expect CF to spit out a select menu with all of the values retrned by #Book.getPhaseIDs()# selected. Unfortunately, nothing gets selected. I found this code in _formelements.xsl:

With that code, if I pass multple values, nothing will ever get selected, since $selectedValues contains a comma delimted list of values (2,6,10 will never match 2 [the current ID]). So I hit up the Coldfusion TMMs for some help, and S. Isaac Dealey of FusionTap came back with this fix:

That code tacks a comma at the beginning and end of the list of selected values, and then uses contains to find out if the list contains the string ",2," instead of just "2".

2 comments | Posted by Daniel Short on Mar 6, 2005 at 12:00 AM | Categories: ColdFusion -

Better late than never

Well if you haven't heard already (since I'm a little slow these days), ColdFusion MX 7 is now out!

0 comments | Posted by Daniel Short on Feb 10, 2005 at 12:00 AM | Categories: ColdFusion -

Beyond Compare

Oh how I love Beyond Compare
It's saved large patches of my hair
It checks my files and keeps me sane
Without it my job would be a pain

2 comments | Posted by Daniel Short on Nov 16, 2004 at 12:00 AM | Categories: .NET - ColdFusion - Rambling - VBScript -