Flex 4 itemRendererFunction problem.

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-05-14T16:12:08Z Indexed on 2010/05/14 16:14 UTC
Read the original article Hit count: 178

Filed under:
|
|

This is a Flex 4 application:

I have created a list as the following:

    <s:List id="previewList"
        horizontalCenter="14"
        verticalCenter="-112" 
        itemRendererFunction="listItemRendererFunction"
        click="controller.previewListClickHandler()">
    </s:List>

And I have the itemRendererFunction:

            public function listItemRendererFunction(item:Object):ClassFactory 
        {
            var cla:Class = SimpleItemRenderer;
            if( item.save == true )
            {
                cla = ColorItemRenderer;
            }
            else
            {
                cla = SimpleItemRenderer;
            }
            return new ClassFactory(cla);
        }

The application works fine if the listItemRendererFunction is inside fx:Script.

However, when I put the listItemRendererFunction into a class and change to the following: itemRendererFunction="controller.listItemRendererFunction" in the List component.

If I run the application, I get the " Error #1009".

Please advice how to fix it.

© Stack Overflow or respective owner

Related posts about flex

Related posts about itemrenderer