views:

17

answers:

1

Hey,

A combo box as an item renderer for a data cell in a Flex Datagrid has been demostrated at various blogs. What if that combo box has to have an external dataprovider that has to be set at the time of converting the renderer class to a ClassFactory.

Can this be done? Or is there a workaround?

Thanks in advance.

A: 

What if that combo box has to have an external dataprovider that has to be set at the time of converting the renderer class to a ClassFactory.

I don't think you meant to say what you said. But, at runtime, a renderer class is never converted into a ClassFactory. The renderer properties, such as itemRenderer or itemEditor are always factories. Now, the Flex compiler does some magic so that you specify the class name in MXML, it turns it into a ClassFactory. This happens at compile time.

I believe you mean that you want to set the dataProvider on the instance of the ComboBox as they are created by the ClassFactory. Is that correct? If so, you can extend the ClassFactory to do so.

You could also extend the ComboBox to be "dataProvider" aware. One approach is to build the remote service call to retrieve data directly into your extended ComboBox. Another might be to hard coded the dataProvider, Yet another might be to access some other application specific component for the data. One such example is using the Cairngorm ModelLocator.

Does that help?

www.Flextras.com