Packagemx.managers
Classpublic class HistoryManager
InheritanceHistoryManager Inheritance Object

History management lets users navigate through a Flex application using the web browser's Back and Forward navigation commands.

History management is enabled by default for the Accordion and TabNavigator containers. This means that if the user selects one of the panes in an Accordion control, that user can return to the previous pane by using the browser?s Back button or back navigation command. History management is disabled by default for the ViewStack navigator container.

You can disable history management by setting the navigator container's historyManagementEnabled property to false.

You can also enable history management for other objects in an application by registering the objects with the HistoryManager. To register a component with the HistoryManager class, you call the HistoryManager class's register() method with a reference to a component instance that implements the IHistoryManagerClient interface. In the following example, the Application component (this) is registered with the HistoryManager class when the Application is initialized:

  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    implements="mx.managers.IHistoryManagerClient" 
    initialize="mx.managers.HistoryManager.register(this);">
  
You must also implement the saveState() and loadState() methods of the IHistoryManagerClient interface to complete the registration of the component. Components that extend UIComponent automatically inherit the loadState() method.

All methods and properties of the HistoryManager are static, so you do not need to create an instance of it.

See also

mx.managers.IHistoryManagerClient
Using standard history management


Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined by
 Inherited
Indicates whether an object has a specified property defined.
Object
  
[static] Initializes the HistoryManager.
HistoryManager
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
[static] Registers an object with the HistoryManager.
HistoryManager
  
[static] Saves the application's current state so it can be restored later.
HistoryManager
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
[static] Unregisters an object with the HistoryManager.
HistoryManager
 Inherited
Returns the primitive value of the specified object.
Object
Method detail
initialize()method
public static function initialize(sm:ISystemManager):void

Initializes the HistoryManager. In general, this does not need to be called because any time you add a component with historyManagementEnabled, Flex calls this method. However, the HistoryManager will not work correctly if it is not initialized from the top-level application. So, if your application does not have any HistoryManager enabled components in it and loads other sub-applications That do, you must call the HistoryManager.initialize() method in the main application, usually from an initialize event handler on the application.

Parameters
sm:ISystemManager — SystemManager for this application.
register()method 
public static function register(obj:IHistoryManagerClient):void

Registers an object with the HistoryManager. The object must implement the IHistoryManagerClient interface.

Parameters
obj:IHistoryManagerClient — Object to register.

See also

save()method 
public static function save():void

Saves the application's current state so it can be restored later. This method is automatically called by navigator containers whenever their navigation state changes. If you registered an interface with the HistoryManager, you are responsible for calling the save() method when the application state changes.

unregister()method 
public static function unregister(obj:IHistoryManagerClient):void

Unregisters an object with the HistoryManager.

Parameters
obj:IHistoryManagerClient — Object to unregister.




Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/201/langref/mx/managers/HistoryManager.html