我的Flex移动应用程序中有这样的视图:
<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>
我想将数据(gelen)发送到tabbedviews(到views.HastabilgileriView / views.MenuView)我该怎么做?
答案 0 :(得分:1)
以这种方式尝试:
<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>
答案 1 :(得分:0)