3 Replies Latest reply on Sep 29, 2009 10:48 AM by _Natasha_

    Refresh component Data?


      Hello Everyone,


      In one of the States ("HotelUserState") of my application I have a component (HotelList) within a component (HotelUser). The idea is that the user can choose which Hotel it wants to add/delete/mod users using the HotelList component, and once chosen it will send an event to HotelUser so it may change to a sub State to show a  user List.


      The problem is that if i navigate away once I've chosen a user and then come back to this State... i will still see the last screen shown, the component won't show data, also data is not refreshed (say if i create a new hotel...).  I would like it to start from scratch everytime, but i cannot seem to get it. I know enterState


      This is how in my main app the state called when selected from a menubar:


      <mx:State name="HotelUserState" >
                  <mx:AddChild position="lastChild">
                      <ns1:HotelUser x="53" y="72">


      Then my HotelUser component looks like this (simplified):


      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"   width="710" height="502" xmlns:ns1="components.*">
          <ns1:HotelList id="hotelList" horizontalCenter="0" verticalCenter="-21">



      In short, how can I have the HotelList component refreshed/recreated it time it is shown so it pulls recent info?I know it must be something really basic... but i cannot seem to be able to do it.


      Any hints are welcome! thank you!