Products

Products
Viewing By Entry / Main
May 16, 2007

Array from cfc to Flex combobox

Someone showed me an error they were getting and it tooka few hours to debug but it was so simple I don't want to miss that again.

He was using remote services in Flex 2 to retrieve an array of structs from a cfc file to fill out a Flex combobox. The data was coming back and we typed it as an Array and everthing but the dropdown kept showing [object Object] instead of the correct label. We had the fieldLabel set correctly to match the param returned from the cfc service. What else could it be??

BINGO! I thought about how action script returns params from cfc services, all in caps. That was it, capitalization. Don't you hate those pesky bugs that turn out to be a tiny fly.

Rule no. 20ish something: Check params returned from cfc services in action script or mxml files to see if they need capitalization.

Comments

If you use <cfset myStruct['myProp'] = something> you won't have that issue anymore.


Nope, sorry but that doesn't work. That breaks it even more.


Hi,

Can you just clairfy what you mean by capitilization? I am having this problem with a structure clansStruct.clanid. How should I be refering to this in the combobox?

Cheers
Peter



Copyright © 2005-2006 Clint Willard. All rights reserved.
Aura skin for Clint Willard's BlogCFC inspired by Brooks Bilson's Bolg.
All trademarks property of their owners.