请教FLEX中一个简单的问题
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.Request;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
internal function init():void
{
products.GetAllProducts();
}
private function onFaultHandler(evt:FaultEvent):void
{
Alert.show("Fault", evt.fault.toString());
}
private function onSelectAllProductsHandler(evt:ResultEvent):void
{
Publics.Bind_DG(evt,dgProduct);
}
]]>
</fx:Script>
<mx:ViewStack width="100%" height="100%" id="viewStack">
<mx:Panel id="HelloWorldView" showEffect="{workspaceEffect}">
<mx:Text text="rapid-framework项目脚手架"/>
</mx:Panel>
<mx:Panel id="HelloView" showEffect="{workspaceEffect}">
<mx:Button label="hello"/>
</mx:Panel>
<mx:Panel id="PowerByView" showEffect="{workspaceEffect}">
<mx:Button label="Powered By Rapid-framework"/>
</mx:Panel>
<mx:Panel id="RapidHOME" showEffect="{workspaceEffect}">
<mx:Button label="http://www.rapid-framework.org.cn" />
</mx:Panel>
<mx:Panel id="DataGridView" showEffect="{workspaceEffect}" width="100%">
<mx:DataGrid id="dgProduct" width="100%" fontSize="14"/>
</mx:Panel>
</mx:ViewStack>
现在在Publics.Bind_DG(evt,dgProduct);方法中dgProduct获取不到。
如果把<mx:Panel id="DataGridView" showEffect="{workspaceEffect}" width="100%">
<mx:DataGrid id="dgProduct" width="100%" fontSize="14"/>
</mx:Panel>
拿到<mx:ViewStack></mx:ViewStack>就可以取到dgProduct对象。
现在想再<mx:ViewStack></mx:ViewStack>里面取到dgProduct,怎么办?