Actually found the solution - set the rowCount of the comboBox to be equal to
the number of items in the dataProvider
rowCount = {fontsList.length()}
seems to have resolved the issue.
Ben Marchbanks wrote:
>
>
> I am using the following item render to display a font list and render
> each in
> its particular font style.
> The dataProvider is XML and the itemRenderer is used for a comboBox.
>
> The problem is the application of the font style is inconsistent - each
> time the
> comboBox is opened the items are rendered and may or may not have a font
> style -
> sometimes even a style from another item in the list.
>
> How can I make this display list more bullet-proof ?
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml>"
> width="150" height="20"
> creationComplete = "doInit()" horizontalGap="0"
> horizontalAlign="center" verticalAlign="middle"
> horizontalScrollPolicy="off" backgroundColor="#c0c0c0">
> <mx:Script>
> <![CDATA[
>
> private function doInit():void{
> var f = data.family
> fontI.setStyle("fontFamily", f)
> trace(f)
> }
>
> ]]>
> </mx:Script>
> <mx:Text text = "{data.label}" id="fontI" />
> </mx:HBox>
>
> Ben Marchbanks
>
> ::: alQemy ::: transforming information into intelligence
> http://www.alQemy.com <http://www.alQemy.com>
>
> ::: magazooms ::: digital magazines
> http://www.magazooms.com <http://www.magazooms.com>
>
> Greenville, SC
> 864.284.9918
>
> --
> Ben Marchbanks
>
> ::: alQemy ::: transforming information into intelligence
> http://www.alQemy.com <http://www.alQemy.com>
>
> ::: magazooms ::: digital magazines
> http://www.magazooms.com <http://www.magazooms.com>
>
> Greenville, SC
> 864.284.9918
>
>
--
Ben Marchbanks
::: alQemy ::: transforming information into intelligence
http://www.alQemy.com
::: magazooms ::: digital magazines
http://www.magazooms.com
Greenville, SC
864.284.9918