<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。
    主站蜘蛛池模板: 亚洲精品国产品国语在线| 在线人成精品免费视频| 日韩在线观看视频免费| 国产精品亚洲а∨天堂2021| 精品一区二区三区无码免费直播 | 久久久亚洲精品蜜桃臀| 久久久无码精品亚洲日韩软件| 永久亚洲成a人片777777| 亚洲精品中文字幕无码蜜桃| 久久久久亚洲AV成人无码网站| 亚洲国产精品乱码一区二区| 亚洲成a人片在线观看中文动漫| 亚洲国产成人精品不卡青青草原| 亚洲第一区视频在线观看| 成人区精品一区二区不卡亚洲| 亚洲美国产亚洲AV| 五月天婷婷精品免费视频| 国产精品网站在线观看免费传媒 | 成人毛片免费播放| 亚洲VA综合VA国产产VA中| 久久久久亚洲AV成人无码| 久久久久精品国产亚洲AV无码| 亚洲av日韩av永久在线观看 | 亚洲中文字幕久久久一区| 一个人看的www免费高清| 91青青国产在线观看免费| 免费观看的av毛片的网站| 国产亚洲色婷婷久久99精品| 亚洲av无码片区一区二区三区| 一区免费在线观看| 欧洲乱码伦视频免费| 亚洲熟妇无码乱子AV电影| 亚洲最大成人网色香蕉| 国产免费内射又粗又爽密桃视频| 黄色三级三级免费看| 国产成人免费视频| 亚洲Av无码乱码在线观看性色| 亚洲美女激情视频| 好吊色永久免费视频大全| 女人被男人躁的女爽免费视频| 亚洲av综合avav中文|