Skip navigation
fsoender
Currently Being Moderated

Passing data between views

Mar 9, 2013 6:54 PM

There is not much basic data on this on the net, can someone help me out with this issue?

I have this spinner list that I want "data" to be sent to a view called "View 2"
How do I write the code in "View 1", and then the receiving end "View 2"?

 

Can I write it like this:

 

 

protected function View 1():void
   {
   navigator.pushView(views.View 2, data);   
   }

 

 

 

This is a spinner in "View 1" I want the "data" to be sent to "View 2":


s:SpinnerListContainer x="22" y="85" width="135" height="110">
  <s:SpinnerList id="ToolSpinnerLeft" width="125" change="ToolSpinnerLeft_changeHandler(event)"
        fontWeight="bold" labelField="data" selectedIndex="1">
   <s:dataProvider>   
    <s:ArrayList>
     <fx:Object data="Test 1"></fx:Object>
     <fx:Object data="Test 2"></fx:Object>         
    </s:ArrayList>
   </s:dataProvider>
  </s:SpinnerList>
</s:SpinnerListContainer>

 
Replies
  • Currently Being Moderated
    Mar 9, 2013 8:42 PM   in reply to fsoender

    IMO, your views should share a model.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 10, 2013 9:15 PM   in reply to fsoender

    Well, you can cheat and store it up on your application and get it from there or FlexGlobals.topLevelApplication or use some sort of Singleton.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 11, 2013 8:32 AM   in reply to fsoender

    Probably because it is a variable and needs binding syntax “

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 11, 2013 8:57 PM   in reply to fsoender

    Maybe I’m not understanding the problem.  I don’t see any obvious problems.  What error do you get?  Setting breakpoints and examining objects will probably help.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2013 6:19 AM   in reply to fsoender

    Consider using "break" in conjunction with switch/case ..

     

    Read up about the switch statement again!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points