Just sharing the solution I got for this with Flex Support. I
basically just used the labelFunction attribute.
<mx:Script>
function formatName( item ) : String {
return item.firstName + " " + item.lastName;
}
</mx:Script>
<mx:ComboBox id="employeeComboBox" labelFunction="formatName"
dataProvider="{ModelLocator.employees}"
/>
I still wondering why the cellRenderer solution didn't work.
cheers,
George
--- In [email protected], "george_lui" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I had a cellrenderer that was originally used in datagrid cell. I've
> since replaced the datagrid with a comboBox. I'm trying to reuse the
> same cellrenderer in the combo using the code below.
>
> <mx:ComboBox id="employeeComboBox"
> creationComplete=
>
"event.target.getDropdown().cellRenderer='com.sf.sfv4.view.sharkfin.FullNameRenderer';
> event.target.getDropdown().variableRowHeight=true" rowCount="10">
> <mx:dataProvider> { ModelLocator.employees } </mx:dataProvider>
> </mx:ComboBox>
>
> The FullNameRenderer cellrenderer I have just takes the first and last
> name of a user vo and concatenates it.
>
> However this isn't working for the combobox. I get and set the
> cellrenderer of the combobox's dropdown property as stated in this
> group by another member, but it doesn't work. Instead I get the user
> vo object displayed.
>
> I'm confused, I'm using the same dataProvider and cellrenderer in the
> combobox as I did in the datagrid. I think there's a difference
> between the two widgets, but I just don't know what it is.
>
> Please advise...
>
> TIA,
> George
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/