HistoryManager is more or less deprecated.  We want folks to use BrowserManager 
going forward.

If you absolutely have to get HistoryManager working in a Spark app, it looks 
like you can try adding a public variable called historyManagementEnabled to 
your application.

    <fx:Script>
        public var historyManagementEnabled:Boolean = true;
    </fx:Script>



On 5/3/10 1:53 PM, "method_air" <[email protected]> wrote:






When a view stack is nested in a spark component, the view stack loses 
'historManagementEnabled' functionality.

Changing mx:Application to s:Application in the following code causes this 
problem:

<?xml version="1.0"?>
<!-- Simple example to demonstrate the Halo ViewStack layout container. -->
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx">

<mx:Panel title="ViewStack Container Example"
 width="75%" height="75%"
 horizontalCenter="0" verticalCenter="0">
<mx:VBox left="10" right="10" top="10" bottom="10">
<s:Label width="100%" color="blue"
 text="Use the Button controls to change panels of the ViewStack container."/>

<mx:HBox>
<s:Button id="searchButton" label="Search Panel"
  click="myViewStack.selectedChild = search;"/>
<s:Button id="cInfoButton" label="Customer Info Panel"
  click="myViewStack.selectedChild = custInfo;"/>
<s:Button id="aInfoButton" label="Account Panel"
  click="myViewStack.selectedChild = accountInfo;"/>
</mx:HBox>

<!-- Define the ViewStack and the three child containers and have it
resize up to the size of the container for the buttons. -->
<mx:ViewStack id="myViewStack" borderStyle="solid" width="100%" height="100%"
  historyManagementEnabled="true">
<mx:Canvas id="search" backgroundColor="#FFFFCC" label="Search" width="100%" 
height="100%">
<mx:Label text="Search Screen" color="#000000"/>
</mx:Canvas>
<mx:Canvas id="custInfo" backgroundColor="#CCFFFF" label="Customer Info" 
width="100%" height="100%">
<mx:Label text="Customer Info" color="#000000"/>
</mx:Canvas>
<mx:Canvas id="accountInfo" backgroundColor="#FFCCFF" label="Account Info" 
width="100%" height="100%">
<mx:Label text="Account Info" color="#000000"/>
</mx:Canvas>
</mx:ViewStack>
</mx:VBox>
</mx:Panel>

</mx:Application>

//////////////

Alex Harui, any ideas how to get around this problem?

Thanks,

Philip

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> , 
"method_air" <loudj...@...> wrote:
>
> Any ideas why historyManagementEnabled seems to be failing here:
>
> <s:VGroup>
> <mx:ViewStack historyManagementEnabled="true">
> <s:NavigatorContent >
> <tunnel:ProductTunnelView/>
> </s:NavigatorContent>
> <s:NavigatorContent>
> <editorHostViews:EditorAppView />
> </s:NavigatorContent>
> <s:NavigatorContent >
> <s:Panel>
> <gallery:GalleryView />
>         </s:Panel>
> </s:NavigatorContent>
> </mx:ViewStack>
> </s:VGroup>
>
> The MX viewstack is nested in a spark component. History management worked 
> when nested in an mx component.
>
> Thanks,
>
> Philip
>






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to