Managed Hosting



Form Utilities CFC
Project Home Blog Forums Wiki Known Issues Contact Project

Form Utilities CFC Issue: Struct Keys names with brackets

Name: Struct Keys names with brackets
ID: 3
Project: Form Utilities CFC
Type: Enhancement
Area: Administration
Severity: High
Status: Closed
Related URL:
Creator: Timothy Farrar
Created: 11/04/08 9:02 AM
Updated: 11/04/08 3:05 PM
Description: The component does not support adding structure keys named in the following format...


This would be a huge plus for me.
History: Created by timothyfarrar@sosensible.com (Timothy Farrar) : 11/04/08 9:02 AM

Comment by timothyfarrar@sosensible.com (Timothy Farrar) : 11/04/08 10:09 AM
I have modified my copy to support the above feature, by replacing lines 84 - 87 with the following:

<cfif local.tempElement contains "['">
   <cfset local.tempElement = local.tempElement & "']">
<cfelseif local.tempElement contains "[">
   <cfset local.tempIndex = ReReplaceNoCase(local.tempElement, '.+\[|\]', '', 'all') />
   <cfset local.tempElement = ReReplaceNoCase(local.tempElement, '\[.+\]', '', 'all') />

Hope this will work!

Comment by brian428 (Brian Kotek) : 11/04/08 1:39 PM
Tim, is there a reason you wouldn't just do form.structKeyName.anyOtherKey? Since the brackets are meant to specify array syntax I'm somewhat leery of trying to make them serve a dual purpose when one can just use the dot syntax.

Comment by timothyfarrar@sosensible.com (Timothy Farrar) : 11/04/08 1:51 PM
Because I sometimes have need of having structure key names that I can't name in coldFusion using the dot syntax. ie. @ characters ect.

Comment by timothyfarrar@sosensible.com (Timothy Farrar) : 11/04/08 1:57 PM
There is a business need, and it fixed it. I'm not interested in providing a use case scenario to prove it... It works and I'm happy.. Just wanted to share the solution w/ others

Comment by brian428 (Brian Kotek) : 11/04/08 3:02 PM
Fine by me Timothy, I was just asking for a reason since no one has ever had an issue with it. I'll consider adding it after I run some tests.

Updated by brian428 (Brian Kotek) : 11/04/08 3:03 PM

Comment by timothyfarrar (Timothy Farrar) : 11/04/08 3:05 PM
I would be glad to help w/ unit testing if you are interested.

To add a comment to this bug, please login using the link above.