• Contact Project
Form Utilities CFC Issue: Struct Keys names with brackets
||Struct Keys names with brackets
||Form Utilities CFC
||11/04/08 9:02 AM
||11/04/08 3:05 PM
The component does not support adding structure keys named in the following format...
This would be a huge plus for me.
Created by firstname.lastname@example.org (Timothy Farrar) : 11/04/08 9:02 AM
Comment by email@example.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 firstname.lastname@example.org (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 email@example.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.
Adobe and the Adobe product names are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States and/or other