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

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

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

    posts - 325,  comments - 25,  trackbacks - 0

    數據格式化
    Flex內置格式化組件

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
       backgroundColor="#FFFFFF" width="500" height="280">

      <mx:DateFormatter id="dateFormatShort" formatString="MM/DD/YY"/>
      <mx:DateFormatter id="dateFormatMedium" formatString="MMM DD, YY"/>
      <mx:DateFormatter id="dateFormatFull" formatString="MMMM DD, YYYY"/>

     <mx:Panel title="Simple Formatter"
      layout="horizontal" width="100%" height="100%">
        <mx:DateChooser id="cal" />
       
        <mx:VBox>
         <mx:Label text="{cal.selectedDate}"/>
          <mx:Label text="{dateFormatShort.format(cal.selectedDate)}"/>
          <mx:Label text="{dateFormatMedium.format(cal.selectedDate)}"/>
          <mx:Label text="{dateFormatFull.format(cal.selectedDate)}"/>
      </mx:VBox>
       
     </mx:Panel>
    </mx:Application>

    當格式化組件出現錯誤信息時
    當無錯誤時,error屬性返回空字符串,當出錯時返回Invalid Data

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
       backgroundColor="#FFFFFF">

      <mx:Script>
        <![CDATA[
        [Bindable]
        public var results:String="";
        public function formatNow():void {
          phoneFormatter.format(phone.text);
          // Check value of error property
          if(phoneFormatter.error == "Invalid value"){
           // append error to results
            results+=phoneFormatter.error+" - "+ phone.text + "<br/>";
          } else {
           // append to results
            results+="Valid Phone Number - "+phoneFormatter.format(phone.text) + "<br/>";
            // format original TextInput
            phone.text=phoneFormatter.format(phone.text);
          }
        }
        ]]>
      </mx:Script>

      <mx:PhoneFormatter id="phoneFormatter"
        formatString="(###) ###-####" validPatternChars="#-() "/>

      <mx:Panel title="Formatter Error Example" width="300" height="300"
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

      <mx:HBox>
        <mx:Label text="Phone number:" />
        <mx:TextInput id="phone" width="75%" change="formatNow()" restrict="0-9()-."/>
      </mx:HBox>
      <mx:TextArea id="formatterResults" htmlText="{results}" width="100%" height="100%" editable="false"/>
      </mx:Panel>
    </mx:Application>

    posted on 2011-03-17 09:44 長春語林科技 閱讀(203) 評論(0)  編輯  收藏 所屬分類: flex
    <2011年3月>
    272812345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

     

    長春語林科技歡迎您!

    常用鏈接

    留言簿(6)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲精品国精品久久99热一| 亚洲欧洲日本精品| 亚洲av无码一区二区三区四区| 97人妻无码一区二区精品免费| 91亚洲国产在人线播放午夜| 日韩内射激情视频在线播放免费| 午夜影院免费观看| 亚洲成熟xxxxx电影| 伊人久久免费视频| 亚洲国产av美女网站| 国产大片线上免费观看| 亚洲日本VA午夜在线影院| 日韩中文无码有码免费视频 | 国产一卡2卡3卡4卡2021免费观看| 亚洲精品视频专区| 亚洲国产精华液2020| 日本免费人成黄页网观看视频| 精品国产日韩亚洲一区91| 无码欧精品亚洲日韩一区夜夜嗨 | 亚洲精品国产第1页| 成年在线观看网站免费| 久久久久亚洲精品无码网址色欲| 九月婷婷亚洲综合在线| 国产啪精品视频网站免费尤物| 337p日本欧洲亚洲大胆精品555588| 日韩av无码成人无码免费 | 97在线免费观看视频| 亚洲精品欧洲精品| 日韩a级毛片免费观看| www成人免费观看网站| 99人中文字幕亚洲区| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 免费观看亚洲人成网站| 久久九九亚洲精品| 成人片黄网站A毛片免费| 黄色免费网址在线观看| 亚洲久本草在线中文字幕| 永久免费看bbb| 七色永久性tv网站免费看| 亚洲精品国产suv一区88| 亚洲人成人77777网站|