3 Replies Latest reply on Jun 25, 2008 12:32 PM by ntsiii

    no select in list with custom itemRenderer

    javamonjoe
      Once a custom itemRenderer, consisting of a canvas with image and label, is introduce to a list control the list loses the ability to select. the selectable attribute is set to true. There are no handlers in the renderer which might eat the event.

      How can I provide the custom itemRenderer without losing the functionality of the list?
        • 1. Re: no select in list with custom itemRenderer
          javamonjoe Level 1
          Another piece of the puzzle:

          If I change the custom renderer to an inline renderer with the same function (VBox instead of canvas now) the selection in the list component works. If I switch back to the simple custom renderer (still a VBox) it doesn't.

          This will be a work around this time because my needs here are simple. I do want an answer though.
          • 2. Re: no select in list with custom itemRenderer
            javamonjoe Level 1
            Another piece of the puzzle:

            If I change the custom renderer to an inline renderer with the same function (VBox instead of canvas now) the selection in the list component works. If I switch back to the simple custom renderer (still a VBox) it doesn't.

            This will be a work around this time because my needs here are simple. I do want an answer though.
            • 3. Re: no select in list with custom itemRenderer
              ntsiii Level 3
              Theoretically, you should avoid using containers as item renderers because they are "heavy" with functionality that you do not need.

              Best practice is to extend or copy and modify ListItemRenderer.as. The source is in the framework folder somewhere.

              This is not trivial, but it is not rocket science either. The Adobe code is well commented and fairly clear.

              Also, google: Alex Harui item renderer, for some examples by an Adobe master.

              Tracy