Coenni
Coenni

Reputation: 197

Push Data Into TabbedViewNavigator in View

I have a view like this in my Flex mobile Application:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" title="aaa" actionBarVisible="false" creationComplete="view1_creationCompleteHandler(event)">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
    <![CDATA[
        import valueObjects.Hasta;
        import mx.events.FlexEvent;
        public var gelen:Hasta= new Hasta();
        protected function view1_creationCompleteHandler(event:FlexEvent):void
        {
            // TODO Auto-generated method stub
            gelen=data as Hasta;

        }

    ]]>
</fx:Script>

<s:TabbedViewNavigator width="100%" height="110%">

    <s:ViewNavigator id="vn1" label="Hasta bilgileri-Hasta Yatış Bilgileri" width="100%" height="100%" firstView="views.HastabilgileriView" />
    <s:ViewNavigator id="vn2" label="Menu-Doktor Bilgileri" width="100%" height="100%" firstView="views.MenuView"/>


</s:TabbedViewNavigator>

And I want to send data(gelen) to tabbedviews (to views.HastabilgileriView/views.MenuView) How can I do that?

Upvotes: 0

Views: 1453

Answers (2)

Antonos
Antonos

Reputation: 573

try it in this way:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" title="aaa" actionBarVisible="false" creationComplete="view1_creationCompleteHandler(event)">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
    <![CDATA[
        import valueObjects.Hasta;
        import mx.events.FlexEvent;
        [Bindable]
        public var gelen:Hasta= new Hasta();
        protected function view1_creationCompleteHandler(event:FlexEvent):void
        {
            // TODO Auto-generated method stub
            gelen=data as Hasta;

        }

    ]]>
</fx:Script>

<s:TabbedViewNavigator width="100%" height="110%">

    <s:ViewNavigator id="vn1" label="Hasta bilgileri-Hasta Yatış Bilgileri" width="100%" height="100%" firstView="views.HastabilgileriView" firstViewData="{gelen}" />
    <s:ViewNavigator id="vn2" label="Menu-Doktor Bilgileri" width="100%" height="100%" firstView="views.MenuView" firstViewData="{gelen}"/>


</s:TabbedViewNavigator>

Upvotes: 1

Sebastian
Sebastian

Reputation: 436

To push data between views you can use :

navigator.pushView(views.SomeView, data);

Check out this link and if you want additional information check out the following link. I think these links will provide you with the information required to achieve your task.

Upvotes: 0

Related Questions