Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass parameters to a view that was previously shown in Flex Mobile Project (I cannot use pushView)
    primarykey
    data
    text
    <p>I have a Flex Mobile Project that I am working on. I am trying to pass parameters from one view to another. The only problem is that I cannot use navigator.pushView to push the View and the parameter as the view I am pushing to was the previous view. So this wipes out using the addHandler() and the returnObjectsCreated() as I cannot use pushView. I am having to use popView because it is my previous view that I have to pass parameters too. Any help would be appreciated.</p> <p>That class that has the parameters I need to pass is below. It is a view that shows a list. So I need to pass list.selectedItem to the popview or previous view...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;amec:BaseBrowseView xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:amec="com.amec.Components.*" title="Select an item"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import com.amec.BaseSql; import mx.collections.ArrayCollection; import mx.events.FlexEvent; import spark.events.IndexChangeEvent; [Bindable]private var resultArr:ArrayCollection = new ArrayCollection(); protected function myList_changeHandler(event:IndexChangeEvent):void { navigator.popView(); //Either send a ref to the last view or override createReturn } [Bindable(event="myDataChanged")] private function get myData():ArrayCollection { } ]]&gt; &lt;/fx:Script&gt; &lt;s:List id="list" height="100%" width="100%" dataProvider="{myData}" labelField="DMV_VALUE_1" change="myList_changeHandler(event);"&gt; &lt;/s:List&gt; &lt;fx:Declarations&gt; &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt; &lt;/fx:Declarations&gt; </code></pre> <p></p> <p>Now below is the previous view that I want to popView to that I need to pass parameters to so I can populate the TextInput with.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;amec:BaseControl xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:amec="com.amec.Components.*" horizontalCenter="true"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import mx.events.FlexEvent; [Bindable] protected var textValue:String; protected function control_creationCompleteHandler(event:FlexEvent):void { // todo: get control data from view.data } protected function control_clickHandler(event:MouseEvent):void { parentView.navigator.pushView(TextListView); } ]]&gt; &lt;/fx:Script&gt; &lt;s:Label text="Robert says something meaningful goes here" /&gt; &lt;s:TextInput id="ns" text="{textValue}" editable="false" click="control_clickHandler(event)"/&gt; &lt;fx:Declarations&gt; &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt; &lt;/fx:Declarations&gt; </code></pre> <p></p> <p>Again I cannot use pushView as the view is already on the stack.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload