warning: unable to bind to property '' on class '' (class is not an IEventDispatcher)
2009-08-17 15:35
519 查看
早上在编程的时候出现 warning: unable to bind to property '' on class 'Object' (class is not an IEventDispatcher) 这种警告!
这些警告,因为如果你有一些代码,修改了个别领域的selectedItem ,有约束力的机制,将无法探测到它们。一种更好的方式来写这将是建立独立的两个变量的值
比如:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
[Bindable]
public var arr: Array = [ {label:"a1", data:1}, {label:"a2", data:2}, {label:"a3", data:3} ];
[Bindable]
public var selectedItemLabel:String = "";
[Bindable]
public var selectedItemData:String = "";
private function Handler(event:Event):void
{
selectedItemLabel=ComboBox(event.target).selectedItem.label;
selectedItemData=ComboBox(event.target).selectedItem.data;
}
]]>
</mx:Script>
<mx:Panel title="ComboBox Control Example"
height="75%" width="75%" layout="horizontal"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:ComboBox dataProvider="{arr}" width="150"
close="Handler(event);"/>
<mx:VBox width="250">
<mx:Text width="200" color="blue" text="selectedItem example!"/>
<mx:Label text="the Selected: {selectedItemLabel}"/>
<mx:Label text="the Data: {selectedItemData}"/>
</mx:VBox>
</mx:Panel>
</mx:Application>
这些警告,因为如果你有一些代码,修改了个别领域的selectedItem ,有约束力的机制,将无法探测到它们。一种更好的方式来写这将是建立独立的两个变量的值
比如:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
[Bindable]
public var arr: Array = [ {label:"a1", data:1}, {label:"a2", data:2}, {label:"a3", data:3} ];
[Bindable]
public var selectedItemLabel:String = "";
[Bindable]
public var selectedItemData:String = "";
private function Handler(event:Event):void
{
selectedItemLabel=ComboBox(event.target).selectedItem.label;
selectedItemData=ComboBox(event.target).selectedItem.data;
}
]]>
</mx:Script>
<mx:Panel title="ComboBox Control Example"
height="75%" width="75%" layout="horizontal"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:ComboBox dataProvider="{arr}" width="150"
close="Handler(event);"/>
<mx:VBox width="250">
<mx:Text width="200" color="blue" text="selectedItem example!"/>
<mx:Label text="the Selected: {selectedItemLabel}"/>
<mx:Label text="the Data: {selectedItemData}"/>
</mx:VBox>
</mx:Panel>
</mx:Application>
相关文章推荐
- 解决此类问题:warning: unable to bind to property '' on class 'Object' (class is not an IEventDispatcher) .
- warning: unable to bind to property '' on class 'Object' (class is not an IEventDispatcher)
- warning: unable to bind to property '' on class 'Object' (class is not an IEventDispatcher)
- Flex warning: unable to bind to property 'name' on class 'Object' (class is not an IEventDispatcher)
- unable to bind to property 'money' on class 'Object' (class is not an IEventDispatcher)
- PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone
- Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings.
- PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings
- 错误整理:Unable to add module to the current project as it is not of packaging type 'pom'
- javax.el.PropertyNotFoundException: 'newsLine' is an unknown bean property...
- Bean property XX' is not writable or has an invalid setter method
- 错误信息:Bean property 'sessionFactory' is not writable or has an invalid setter method.
- There is no READABLE property named 'day' in class 'java.lang.String';You have an error in your SQL
- unable to find javac compiler;com.sun.tools.javac.Mainisnotontheclasspath的问题的解决
- Warning: array_merge() [function.array-merge]: Argument #2 is not an array in e\\class\\functions.php on line 2193
- Bean property 'service' is not writable or has an invalid setter method. Did you mean 'serivce'?
- 解决com.sun.tools.javac.Main is not on the classpath / Unable to find a javac compiler 的问题
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME
- error: internal error: unable to execute QEMU command 'migrate': this feature or command is not cur
- Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key