不一致型のプロパティに対して双方向データバインディングを実行する簡単な方法はありませんか?このコード結果をコンパイルしようとする(s:TextInput
からtext
性)タイプString
の一方(Foo
からbar
性)タイプNumber
の他の不一致型のプロパティのFlex 4双方向データバインディング
package com.example
{
public class Foo
{
[Bindable] public var bar:Number;
}
}
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ex="com.example.*"
>
<fx:Declarations>
<ex:Foo id="foo" />
</fx:Declarations>
<s:TextInput text="@{foo.bar}" /><!-- error at this line -->
</s:Application>
:私はお互いに2つのプロパティをバインドしようとしていた次の例で次のエラーで:
1067: Implicit coercion of a value of type String to an unrelated type Number.
エラーが発生した理由を私は理解し、私は間の変換の試みを可能にする何か(のFlex 4メタデータのおそらくいくつかの並べ替え)の単純無知だ場合、私は思っていましたt種類およびWOような変換が失敗した場合、実行時エラーを投げ...