1 Reply Latest reply on Sep 26, 2013 12:19 AM by Vibhuti Gosavi(InfoCepts)

    How do you clear cached states??

    nakea

      This must be a simple answer, but I'm stuck.

       

      I have a form that is filled out in three steps and is seperated by <states>. After submitting the form on the final state, I want to start all over again, but if I try to call the component with the states again, it starts with the last state and still has all the information just entered.

       

      How do you clear the informaiton?

        • 1. Re: How do you clear cached states??
          Vibhuti Gosavi(InfoCepts) Level 3

          Hi,

           

          Try using itemDestructionPolicy attribute. Following is the related information :

          Controlling caching of objects created in a view state

           

          A change to a view state can cause Flex to create an object. By default, after Flex creates the object, the object is cached indefinitely, even after you switch to another view state. The item is cached even if the destination view state excludes the object.

          Use the itemDestructionPolicy attribute with the includeIn and excludeFrom attributes configure Flex to completely destroy the object when leaving a view state, including deleting it from the cache. Typically it is more efficient to allow items to be cached because it improves performance when switching back to the view state that created the object, or to a view state that uses the object. However your application might define a view state that is rarely used, and you do not want to allocate memory for caching the object.

          You can use the itemDestructionPolicy attribute on any object in MXML that supports the includeIn and excludeFrom attributes. The possible values foritemDestructionPolicy are never (default) and auto.

          The value of never specifies that the object is cached indefinitely. A value of auto means that the object is destroyed when leaving a view state where the object exists. The following example sets the attribute to auto:

          <s:TextInput includeIn="newTextInput" itemDestructionPolicy="auto"/>

           

          http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ffa.html

           

          Thanks and Regards,

          ---------------------------------------------------------------------------------

          Vibhuti Malwatkar | vgosavi@infocepts.com | www.infocepts.com

          ---------------------------------------------------------------------------------