<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-75  評論-193  文章-5  trackbacks-0
    P984
    Data binding requires a source property, a destination property, and a triggering event that
    indicates when to copy the data from the source to the destination.

    數據綁定需要一個源,一個目標和需要從源拷貝數據到目的一個觸發事件。

    注意:這句話解釋了數據綁定的本質。也引出了下面的一段話。

    You can use all properties of a component as the destination of a data binding expression.
    However, to use a property as the source of a data binding expression,the component must be
    implemented to support data binding, which means that the component dispatches an event
    when the value of the property changes to trigger the binding
    .
    For more information on
    creating component properties that can be used as the source of a data binding expression, see
    “Bindable metadata tag” in Creating and Extending Flex 2 Components.

    上面這段話的關鍵含義在于有下劃線的這一段: 控件必須支持數據綁定,這意味著當屬性改變時控件必須發送一個事件來觸發數據綁定的操作。

    In addition to properties, you can use ActionScript functions as the source of binding
    expressions. You usually do this when using a bindable property as an argument of a function.
    When the property changes, the function executes, and the result is used in the binding
    destination.

    對于實行,可以使用ActionScript的函數做為綁定表達式的源。通常可以使用一個綁定的屬性做為函數的參數,這樣當屬性變化時,函數將會執行,結果就會被綁定的目的使用。

    注:對上面一段話有了初步的理解,不過最好能有一個例子說明,可惜還沒看到:(

    You can also use a property of type Function as a binding source or destination. A property of
    type Function is a variable that holds a reference to a function.

    注:這也是一個說明函數與數據綁定相關的使用方法。
    下面終于就要講到數據綁定的具體使用方法了。

    Binding data with curly braces

    舉例如下:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="<!-- Data model stores registration data that user enters. -->
    <mx:Model id="reg">
    ???<registration>
    ??????<name>{name.text}</name>
    ??????<email>{email.text}</email>
    ??????<phone>{phone.text}</phone>
    ??????<zip>{zip.text}</zip>
    ??????<ssn>{ssn.text}</ssn>
    ???</registration>
    </mx:Model>
    <!-- Form contains user input controls. -->
    <mx:Form>
    ???<mx:FormItem label="Name" required="true">
    ??????<mx:TextInput id="name" width="200"/>
    ???</mx:FormItem>
    ???<mx:FormItem label="Email" required="true">
    ??????<mx:TextInput id="email" width="200"/>
    ???</mx:FormItem>
    ???<mx:FormItem label="Phone" required="true">
    ??????<mx:TextInput id="phone" width="200"/>
    ???</mx:FormItem>
    ???<mx:FormItem label="Zip" required="true">
    ??????<mx:TextInput id="zip" width="60"/>
    ???</mx:FormItem>
    ???<mx:FormItem label="Social Security" required="true">
    ??????<mx:TextInput id="ssn" width="200"/>
    ???</mx:FormItem>
    ???...
    </mx:Form>
    </mx:Application>

    上面的例子很清楚的說明了使用{}做為數據綁定的用法。不過在上面的例子中使用到了DataModel,關于Data Models請參見?Chapter 38, “Storing Data,” on page 1001。
    主站蜘蛛池模板: 日韩人妻无码免费视频一区二区三区 | 国产在线精品一区免费香蕉| 亚洲国产精品综合福利专区| 国产亚洲AV夜间福利香蕉149| 日韩高清免费观看| 国产麻豆视频免费观看| 亚欧免费无码aⅴ在线观看| 乱淫片免费影院观看| 亚洲av午夜电影在线观看 | 最近中文字幕高清免费中文字幕mv| 成年大片免费高清在线看黄| 亚洲国产成人综合精品| 亚洲国产综合在线| 亚洲精品网站在线观看你懂的| 亚洲国产精品VA在线看黑人 | 一级毛片a女人刺激视频免费| 国产精品亚洲一区二区在线观看| 久久亚洲精品国产精品婷婷 | 国产精品1024永久免费视频| 国产情侣久久久久aⅴ免费| 一出一进一爽一粗一大视频免费的| 亚洲欧美成人综合久久久| 国产99在线|亚洲| 亚洲国产成人久久综合一区| 亚洲视频在线一区二区三区| 无码欧精品亚洲日韩一区| 亚洲AV第一页国产精品| 久久综合图区亚洲综合图区| 久久亚洲国产午夜精品理论片 | 久久毛片免费看一区二区三区| 老外毛片免费视频播放| 美女扒开尿口给男人爽免费视频| 久久精品国产亚洲AV电影网| 亚洲AV噜噜一区二区三区| 国产成人人综合亚洲欧美丁香花 | 国产精品色午夜免费视频| 大学生a级毛片免费观看| 免费看片免费播放| 国产真人无遮挡作爱免费视频| 免费a级黄色毛片| 亚洲性日韩精品一区二区三区|