2 Replies Latest reply on Mar 22, 2010 1:21 AM by Luis Pedro Ferreira

    Reset or recall init on a component. Is it possible?

    Luis Pedro Ferreira Level 1

      Is there any way to reset a component when it is moved to the stage so it can plays all the transations and dispatch all the events?


      I will explain...


      I have 2 componentes inline in the stage [Component 1] and [Component 2]

      At the moment we can only see [Component 1] cause [Component 2] is hidden outside the edge of the stage.

      When we click somewhere, the [Component 1] hides away and the [Component 2] is shown with an slide effect.


      <--- [Component 1] <-- [Component 2]


      By the first time i call [Component 2] to be shown, everything goes fine, but when i go back to [Component 1] and try to call the [Component 2] again, and because i had called earlier, the component (how can i explain) has everything loaded, i can't even make it dispatch the creationComplete...


      Do you have any suggestion to solve this??

      Is there any solution with something like reset, recall.....


      Thanks all!

        • 1. Re: Reset or recall init on a component. Is it possible?
          Flex harUI Adobe Employee

          If you actually change visible=true/false, you can use the show Event the

          second time around.

          1 person found this helpful
          • 2. Re: Reset or recall init on a component. Is it possible?
            Luis Pedro Ferreira Level 1

            Ok, I understand you. Using the show and hide method to dispatch events on the [Component 2], but how can I "reset" for example a comcoBox dataprovider already loaded with data?


            Puting on another way:

            I have a [products_grid_component] and a [product_details_component]...to go from de grid to the details I wanna use an effect like I explain on my 1st post. I have a comboBox located in the [product_details_compoent] with several options fot that product_id  that i'm showing the details.


            What happen is, for example, the comboBox's dataprovider is loaded with [Value1][Value2][Value3] and [Value 4] for the product_id=22 (example), when i call the [products_details_component] for the 1st time, I open the comboBox and all the data is displayed correctely with 4 options ([Value1][Value2][Value3] and [Value 4]). Then i go back to [products_grig_component] (both components slides right showing the [products_grid_component] and hidding the [product_details_component]) when i go to [product_details_component] to view the product_id=30, the comboBox behaves like this: imaging that the dataprovides contains [Value 15][Value 16][Value 17][Value 18] and [value 19]...now is the funny part...the comboBox index 0 is [Value 15] but when i open it i can see a space for 4 optnios, a scroolBar and it is still loaded with [Value1][Value2][Value3] and [Value 4] but if i select [Value2] what is going to be displayed is [Value16] and i after i had selected an option, the comboBox shows the optnios correctly..It looks like the comboBox dataprovider is not refreshed.


            I already tryed to refresh() the dataprovider, empty the dataPRovider and loaded again with data, etc....but is def something i'm not doing right.

            How can i turn around this??