Question regarding ViewStack

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Question regarding ViewStack

    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 can click 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 have found that if I go back to page 1 by using
    something other than the back button say a flex 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)"/>

    bitwyse Guest

  2. Similar Questions and Discussions

    1. Can I user Repeater in a ViewStack?
      Can I user Repeater in a ViewStack like this/? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"...
    2. possible ViewStack bug
      There seems to be something wrong with the mx:ViewStack.... I think the code is pretty obvious but what happens is that when a Tree is inside a...
    3. ViewStack issue
      Hello, I have a viewstack called myviewstack1 having three view children i.e. view1,view2 and view3. I also have another view stack called my...
    4. Binding a ComboBox to a ViewStack
      Hi all, Anybody have any luck getting a ComboBox to bind to a ViewStack? I'm trying to set it up so that the ComboBox will use the...
    5. ViewStack Problem!
      Hi All, I have a problem with ViewStack, when I click the first time on the first button that called a file, for example when I click on "SMET...
  3. #2

    Default Re: Question regarding ViewStack

    Bump
    bitwyse Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139