与弹出窗口交配<<伴侣论坛一> <转换应用/ p>
如果我理解正确的话,这里是一些代码,你需要什么(改编自该线程)。它注入RPC调用到视图的结果(保持地图不可知怎么视图显示的数据),视图将创建一个弹出每当有数据,并删除弹出时没有数据。螺纹具有的最此代码的进一步解释。
EventMap:
<Injectors target="{PopupParentView}">
<PropertyInjector destinationKey="rpcData"
source="{FooManager}" sourceKey="rpcData" />
</Injectors>
PopupParentView:
...
private var popup : UIComponent;
private var rpcData : Object;
private function onPreinitialize( event : Event ) : void {
BindingUtils.bindSetter(rpcDataChanged, this, "rpcData");
}
private function rpcDataChanged( value : Object ) : void {
invalidateProperties();
}
override protected function commitProperties( ) : void {
// two mutually exclusive branches: either the property can be interpreted as "show the popup"
// and the popup doesn't exist, or we shouldn't show the popup, but it does exist. all other
if ( rpcData != null && popup == null ) {
popup = PopUpManager.createPopUp(...);
} else if ( rpcData == null && popup != null ) {
// make sure to set the popup property to null
PopUpManager.removePopUp(popup);
popup = null;
}
}
</Script>
...