3 Replies Latest reply on Oct 3, 2011 12:58 PM by Flex harUI

    Arraylist of different type of objects, one list, what about itemrenderer?

    Filmzaddict Level 1

      Hello,

       

      I have a list inside of which i d like to display some objects. These objects types have (almost) nothing in common. Some of these objects might be rendered with a simple TextInput, some with a checkbox and some with a numeric stepper, depends on the kind of object. My question is, what would be the most appropriate way to use an itemrenderer to display these objects in the way i described, First thing that comes to mind is to create an itemrenderer with all the controls/components i need, puting them into states, overriding Data property of renderer where i would detect the actual type of the object and apply some logic to display the controls i want, but that would make an itemRenderer rather 'heavy' memory use wise.

       

      Any other ideas?

       

      Thank you