3 Replies Latest reply on Mar 8, 2007 4:44 PM by ntsiii

    How to get reference to 1st item of HorizontalList

    wushupork
      How do I get the reference to 1st item of HorizontalList after it's been dynamically populated with a dataprovider. The HorizontalList uses an itemrenderer and I need a reference to the 1st item to generate a click event
        • 1. Re: How to get reference to 1st item of HorizontalList
          ntsiii Level 3
          I see danger here. You understand that you cannot interact with the data in a list by accessing the item renderer from the outside?

          What is your click going to do? And why only the first item? If it is really always the first item, then you can reference the item using dataProvider[0] And the list already provides a click event, right? What are you attempting?

          Tracy
          • 2. Re: How to get reference to 1st item of HorizontalList
            wushupork Level 1
            Basically the HorizontalList provides a view of data. When clicking on an item in the list, you get a detailed view of the data.

            The behavior I want is to have the 1st item automatically show it's detail view - and since the code to show the detail view already works (it just needs a click from the 1st item) - I would like the HorizontalList to be able to generate a click of the 1st item when it's loaded

            I hope that helps
            • 3. Re: How to get reference to 1st item of HorizontalList
              ntsiii Level 3
              Ah, your want to simulate a user click on the first item. I do not think you can do this directly

              Instead, set the list selectedItem=[0] in the result handler. But if the detail display is invoked by the click event, then that only fires on user interaction, not programmatic setting. You can either call the click handler in the valueCommit event(I think), or just manually call the show detail code in the result handler.

              Tracy