Hi All,

I am having an issue with the ViewStack when the user clicks the back
button. The browser takes them back a page however, my Flex
application doesn't recognize the change thus none of my links work on
the previous page. Let me give an example as that sounds confusing.

The user is viewing a page in my application. Lets call it page one.
On page one the user clicks a link to go to page 2. Now the user is
viewing page 2 and clicks the back button to go back to page 1. For
some reason the link to page 2 no longer works. I found if the user is
viewing page 2 and clicks a button or link that use flex code to
navigate to Page 1, anything besides the back button, then the links
on page 2 will work. Below is some sample code of how I am working
with the ViewStack Links and Buttons . . .

Thanks for any help you can offer .. . ..

private function showPage( pageNumber : Number ) : void
{
        switch( pageNumber )
        {
                case (1) :
                        model.workflowState = ModelLocator.PAGE_1;
                        break;
                case (2) :
                        model.workflowState = ModelLocator.PAGE_2;
                        break;
                case (3) :
                        model.workflowState = ModelLocator.PAGE_3;
                        break;
        }
}

public function getView( workflowState : Number ) : Container
{
        switch( workflowState )
        {
                case ( ModelLocator.PAGE_1 ) :
                        return somePage1;
                
                case ( ModelLocator.PAGE_2 ) :
                        return somePage2;
                
                case ( ModelLocator.PAGE_3 ) :
                        return somePage3;
        }

        return pageError;
}        

<mx:ViewStack id="appView" width="100%" height="100%"
    selectedChild="{getView( model.workflowState )}"
historyManagementEnabled="true">
        <view:Page1 id="somePage1" />
        <view:Page2 id="somePage2" />
        <view:Page3 id="somePage3" />
</mx:ViewStack>


<mx:Text styleName="linkText" text="Link to Page 2"
mouseChildren="false" buttonMode="true" useHandCursor="true"
click="showPage(2)"/>
<mx:Button label="Go to Page 1" click = "showPage(1)"/>

Reply via email to