Select to view content in your preferred language

Mobile Apps State

1039
7
10-12-2011 02:00 PM
BrianGustafson
Occasional Contributor
I have an application with multiple views and when I get back to the map view the map goes back to its original state.  Is there away to keep the map state when I navigate between views?
Tags (2)
0 Kudos
7 Replies
KarlMagnusson
Deactivated User
This is a guess, but can't you use the state as data when pushing between map view and other views?
/Karl M
Växjö, Sweden
navigator.pushView(yourview, thestatename);
0 Kudos
AaronNash
Deactivated User
I have not found a way, but I was able to create a different way to retain the map view when I wanted to display data from an identify task. I created a new vgroup with my identify results and set the visibility to false, then made a button that did this
  private function change():void
  {
   if (map.visible==true)
   {
    map.visible = false;
    resultlist.visible = true;    
   }
   else
   {
    map.visible = true;
    resultlist.visible = false;
   }
  }


works well for my application
0 Kudos
BrianGustafson
Occasional Contributor
At the user conference during the advanced flex session this was done and I thought that there was a property on the map or on the view that was set.  I did not write it down and I cannot find the code or slides from the session.
0 Kudos
AaronNash
Deactivated User
if you are using a TabbedViewNavigatorApplication you can set persistNavigatorState="true" and in each view set destructionPolicy="never" if this is set the views will be cached in memory.
0 Kudos
BrianGustafson
Occasional Contributor
I am using a ViewNavigatorApplication.  I tried setting the persistNavigatorState="true" and in the view I set the destructionPolicy="never" but the map still goes back to its origional state when I navigate back to it.
0 Kudos
AaronNash
Deactivated User
just create a button and the click should be click="navigator.popView()" just tested it in a new view and I was able to go back to my map view without starting from the beginning
0 Kudos
BrianGustafson
Occasional Contributor
That was all it took.  I was using pushView() for both when I really only needed it to pass data to one view and not back to the map.

Thanks.
0 Kudos