6 Replies Latest reply on Jul 23, 2010 9:57 AM by kminKeller-si5I0P

    Retain the selected index of a HorizontalList

    kminKeller-si5I0P

      I have a horizontalList that gets populated with a data provider. My page refreshes ever after certain interval of 30, 60 secs.

       

      Say I have 5 item in the list. So when I select an item in the list at index 3, its item is highlighted with a different color. Now When the page refreshes in 30 secs, I loose the highlight. How do I retain the highlight color on refresh so that I know which item I was viewing.

       

      I throw an event everytime the page refreshes and I store the selected index on my model. But I could not set the property of the selected item as highlighted or selected.

      here is the code how i am setting it up.

       

      private function handleAppRefreshed(event:Event): void {

      trace("Index: " + model.selectedHLIndex);

      hlist.selectedIndex = model.selectedHLIndex; // where hlist is the horizontalList

      }

       

      Any help will be appreciated. Thanks.

       

      KM