0
votes

Refer back to : flex mobile TabbedViewNavigatorApplication back button

I have 2 Tabs. Tab1 has 2 sub Views:

Tab1

Tab1subViewA

Tab1subViewB

Tab2

subview...

In Tab1 (Tab1SubViewA is the first View), -> I navigate to Tab1SubViewB (still under Tab1).

How can I go back to previous view (Tab1SubViewA)?

Note: it's not moving from Tab to Tab but moving from View to View all in the same Tab.

code for Tab1SubViewA:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" title="Tab1subViewA">

<s:Button click="{navigator.pushView(Tab1subViewB)}" />
</s:View>

code in TabbedViewNavigatorApplication:

...
<s:ViewNavigator firstView="views.Tab1subViewA" label="Page1" height="100%" width="100%" >
    <s:titleContent>
      <s:Button click="BackBtn(event)" label="Back"/>
    </s:titleContent>
  </s:ViewNavigator>

  <s:ViewNavigator firstView="views.Tab1subViewB"  label="Page2" height="100%" width="100%">
    <s:titleContent>
      <s:Button click="BackBtn(event)" label="Back"/>
    </s:titleContent>
  </s:ViewNavigator>

</s:TabbedViewNavigatorApplication>
1
Hiya James, what kind of container is dictating the display of the sub views within the first tab? Are they in a view stack controlled by a tab bar or something along those lines, could you post the code for Tab1 with sub-views/container.shaunhusain
@ shaunhusain pls refer to updated question. Not quite sure your question but in View Tab1SubViewA i only have a button that go to Tab1SubViewB. and on top of each views has an Actionbar with a Back button.jameslcs
i found one simple way of doing it, just hard code it. If you really don't have a lot of views into each Tab (and mostly don't anyway), hard coding it is not that bad. Well, if anyone want to give a non-hard code solution to the above is welcome. :-)jameslcs
yah I was sort of thinking that hard coding it is probably the easiest way if there's not too many views. Glad you found a solution, you can answer your own question and accept it so the info is out there for anyone else who stumbles on this post.shaunhusain

1 Answers

0
votes

i found one simple way of doing it, just hard code it. If you really don't have a lot of views into each Tab (and mostly don't anyway), hard coding it is not that bad. Well, if anyone want to give a non-hard code solution to the above is welcome.