我有一個PresentationModel
AS類,其中包含SomeView.mxml
中使用的所有值。模型的整個類都是可綁定的,並且視圖中的模型屬性也是可綁定的。然而,我無法使用PropertyInjector
標籤注入模型到視圖:注入由OjbectBuilder創建的對象作爲屬性來查看
- INFO: Data binding will not be able to detect assignments to model
會有人與熟悉並且靈活數據綁定和隊友給我個忙嗎?非常感謝!
MainEventMap.mxml
<EventHandlers type="{FlexEvent.INITIALIZE}">
<ObjectBuilder generator="{PresentationModel}" registerTarget="true">
<Properties dispatcher="{scope.dispatcher}"/>
</ObjectBuilder>
</EventHandlers>
<Injectors target="{SomeView}" debug="true">
<PropertyInjector targetKey="model" source="{PresentationModel}" />
</Injectors>
段從PresentationModel.as
[Bindable]
public class PresentationModel extends EventDispatcher
{
public var dispatcher:IEventDispatcher;
//.....other variables and functions
}
段從SomeView.mxml
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="518" height="562" >
<mx:Script>
<![CDATA[
//...... all the imports
[Bindable]
public var model:OSGiBrokerConsoleModel;
// ......other variables and functions
]]>
</mx:Script>
// ..... actual view components
</mx:Canvas>
PresentationModel的其餘部分是什麼樣的? – Stiggler 2009-11-10 18:07:46