1 Reply Latest reply on Feb 10, 2009 6:59 AM by peterent

    Accessing controls from ItemRenderer

    Sankar Kethineni Level 1
      Hi All,

      I have 2 component files in my Application.One for the List to display the data and another for ItemRenderer to display more than one data field.

      I have declared some of the controls(flex controls) in the itemRenderer component file.We can access the controls defined in parent component file in the ItemRenderer with the help of parentDocument but How do i access the controls(with the help of id's) of ItemRenderer in my parent component file

      Thanks,
      sankar
        • 1. Re: Accessing controls from ItemRenderer
          peterent Level 2
          Hi. It is not a good idea to access itemRenderers from outside of the list. We intentionally make this difficult because itemRenderers are recycled and you have no control over when the recycling happens.

          If you need to make an itemRenderer do something programmatically, add more fields to the data it is rendering. Update the fields in the dataProvider for the list, making sure you use the dataProvider's itemUpdate() function when the changes are in place.

          The list will notify the itemRenderer to refresh itself (usually by calling its set data function) at which time the itemRenderer can look at these fields and determine what to do.