I think I just saw the same problem. Did you find a resolution? Thanks.
That's an old post. Please provide more details and some code.
I just tried writing a little stand-alone example and it worked. My real example is a very big program that worked in Flex 3 and has just been moved into Flex 4, using 99% the same code. The program is mostly working but a few things aren't.
My real program is way too big to post and also it's my company's proprietary code. To describe it: there is a DataGrid. It uses a factory to create a renderer for one of the columns and sets the headerRenderer and itemRenderer of the column to the factory. It does setProperties on one of the factory objects to set some values. The values are not getting set when the renderers are being created, they were being set in Flex 3.
I debugged and set a breakpoint in ClassFactory.newInstance() and it seems like this is not being called. It seems like if this were being called everything would work because there's the line "if (properties != null) " that sets the properties of the new renderer object. But the debugger makes it seem like newInstance isn't getting called.
So I still think something is wrong but I can't supply an example. Do you have any ideas I could try? Thanks.
Remember that itemRenderers get recycled, and in Flex 4, so do
headerRenderers. Therefore, relying on the factory properties object to
customize individual instances is unreliable and not recommended.
Everything about renderers should be data-driven off the data property
and/or listData property.
Using the debugger some more I found an interesting stack trace:
Looking at the source of DataGridColumn.replaceItemRendererFactory, it looks like it creates a new factory object but doesn't copy the properties of the old factory to the new factory. Is that the problem?
My records show that is fixed in 4.1
Thanks for the help. We figured out a temporary workaround and I'm glad it's fixed in 4.1.