成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

實現Flex數據分頁查詢的幾種處理方法

開發 后端
這段時間空閑的時候都在用Flex結合自己開發的框架做一些應用,在這里介紹一下如何進行Flex數據分頁查詢,順便介紹一下Flex結合框架進行應用開發。

首先看下Flex數據分頁查詢需要的應用效果<!--[if !vml]-->

Flex數據分頁查詢效果

<!--[endif]-->

實際功能包括對Customer進行條件和Flex數據分頁查詢,客戶相關國家數據查詢。

  1. <!--[if !supportLists]-->l        <!--[endif]-->服務端功能處理  
  2. <!--[if !supportLists]-->u     <!--[endif]-->根據邏輯定義相關數據操作實體類  
  3.     [Table("Customers")]  
  4.     interface ICustomer  
  5.     {  
  6.         [ID]  
  7.         string CustomerID { get; set; }  
  8.         [Column]  
  9.         string CompanyName { get; set; }  
  10.         [Column]  
  11.        string ContactName { get; set; }  
  12.         [Column]  
  13.         string ContactTitle { get; set; }  
  14.         [Column]  
  15.         string Address { get; set; }  
  16.         [Column]  
  17.         string City { get; set; }  
  18.        [Column]  
  19.         string Region { get; set; }  
  20.         [Column]  
  21.        string PostalCode { get; set; }  
  22.         [Column]  
  23.         string Country { get; set; }  
  24.         [Column]  
  25.         string Phone { get; set; }  
  26.        [Column]  
  27.         string Fax { get; set; }  
  28.     }  
  29.     [Table("Customers",DISTINCT=true)]  
  30.     interface ICountry  
  31.     {  
  32.         [Column("Country")]  
  33.         string Name { get; set; }  
  34. }  
  35. <!--[if !supportLists]-->u     <!--[endif]-->定義邏輯方法  
  36.    [Service]  
  37.     public class CustomerService  
  38.     {  
  39.         public IList<Customer> List(string matchCompanyName,string country, [Output]DataPage datapage)  
  40.         {  
  41.             Expression exp = new Expression();  
  42.             if (!string.IsNullOrEmpty(matchCompanyName))  
  43.                 exp &= Customer.contactName.Match(matchCompanyName);  
  44.             if (!string.IsNullOrEmpty(country))  
  45.                 exp &= Customer.country == country;  
  46.             datapage.RecordCount = exp.Count<Customer>();  
  47.             return exp.List<Customer>(new Region(datapage.PageIndex,datapage.PageSize));  
  48.         }  
  49.         public IList<Country> ListCountry()  
  50.         {  
  51.             Expression exp = new Expression();  
  52.             return exp.List<Country>();  
  53.         }  
  54. }  
  55. <!--[if !supportLists]-->l        <!--[endif]-->Flex功能處理  
  56. <!--[if !supportLists]-->u     <!--[endif]-->定義AS邏輯代理方法  
  57.     import Core.Utility;  
  58.     /**  
  59.     * Action Script調用方法生成工具1.0  生成時間:2009-7-27 21:39:39  
  60.     */  
  61.    public dynamic class CustomerService_List  
  62.     {  
  63.        public var Callback:Function;  
  64.        public var matchCompanyName:Object;  
  65.        public var country:Object;  
  66.       public var PageIndex:Object;  
  67.        public var PageSize:Object;  
  68.       public var RecordCount:Object;  
  69.        public var PageCount:Object;  
  70.        public var OrderField:Object;  
  71.        public function Execute(method:String="get"):void  
  72.        {  
  73.            this._TimeSlice = new Date();  
  74.            Utility.CallMethod("CustomerService_List",this,Callback,method);  
  75.        }  
  76.     }  
  77.     import Core.Utility;  
  78.     /**  
  79.     * Action Script調用方法生成工具1.0  生成時間:2009-7-27 21:39:43  
  80.     */  
  81.     public dynamic class CustomerService_ListCountry  
  82.     {  
  83.        public var Callback:Function;  
  84.        public function Execute(method:String="get"):void  
  85.        {  
  86.           this._TimeSlice = new Date();  
  87.            Utility.CallMethod("CustomerService_ListCountry",this,Callback,method);  
  88.        }  
  89.     }  
  90. <!--[if !supportLists]-->u     <!--[endif]-->在界面定義邏輯操作對象  
  91.    <mx:Script> 
  92.         
  93.            [Bindable]  
  94.            private var Customers:Object = new ArrayCollection();  
  95.            [Bindable]  
  96.            private var Countrys:Object = new ArrayCollection();  
  97.            private var getCustomer = new CustomerService_List();  
  98.            private var getCountry = new CustomerService_ListCountry();  
  99.        ]]> 
  100.     mx:Script> 
  101. <!--[if !supportLists]-->u     <!--[endif]-->設置國家Combox數據源綁定  
  102. <mx:ComboBox id="txtCountry"  dataProvider="{Countrys}"    
  103. labelField="Name" editable="true" width="135"   
  104. color="#000000">mx:ComboBox> 
  105. <!--[if !supportLists]-->u     <!--[endif]-->設置客戶查詢數據源綁定  
  106.     <mx:DataGrid dataProvider="{Customers}" width="100%" height="100%"> 
  107.        <mx:columns> 
  108.            <mx:DataGridColumn headerText="CustomerID" dataField="CustomerID"/> 
  109.            <mx:DataGridColumn headerText="CompanyName" dataField="CompanyName"/> 
  110.            <mx:DataGridColumn headerText="ContactName" dataField="ContactName"/> 
  111.            <mx:DataGridColumn headerText="ContactTitle" dataField="ContactTitle"/> 
  112.            <mx:DataGridColumn headerText="Address" dataField="Address"/> 
  113.            <mx:DataGridColumn headerText="City" dataField="City"/> 
  114.            <mx:DataGridColumn headerText="Region" dataField="Region"/> 
  115.            <mx:DataGridColumn headerText="PostalCode" dataField="PostalCode"/> 
  116.            <mx:DataGridColumn headerText="Country" dataField="Country"/> 
  117.            <mx:DataGridColumn headerText="Phone" dataField="Phone"/> 
  118.            <mx:DataGridColumn headerText="Fax" dataField="Fax"/> 
  119.        mx:columns> 
  120.     mx:DataGrid> 
  121. <!--[if !supportLists]-->u     <!--[endif]-->在界面初始化事件中定義相關方法加調處理  
  122.     <mx:initialize> 
  123.         
  124.            getCountry.Callback= function(result:XML,err:Boolean){  
  125.                 Countrys= result.Data.Country;  
  126.            };  
  127.                  getCustomer.Callback = function(result:XML,err:Boolean){  
  128.               Customers = result.Data.Customer;  
  129.               if(getCustomer.FristSearch)  
  130.              {  
  131.                   dp.Open(getCustomer.PageSize ,result.Properties.datapage.RecordCount)  
  132.               }  
  133.            };  
  134.            getCustomer.PageSize=10;  
  135.            getCustomer.FristSearch = true;  
  136.            getCountry.Execute();  
  137.           getCustomer.Execute();  
  138.        ]]> 
  139.     mx:initialize> 
  140. <!--[if !supportLists]-->u     <!--[endif]-->查詢按鈕相關功能處理  
  141.        <mx:Button label="Search" icon="@Embed(source='Search.png')"> 
  142.            <mx:click> 
  143.               
  144.                  getCustomer.FristSearch = true;  
  145.                   getCustomer.matchCompanyName = txtCompanyName.text;  
  146.                   getCustomer.country = txtCountry.text;  
  147.                   getCustomer.PageIndex =0;  
  148.                   getCustomer.Execute();  
  149.               ]]> 
  150.            mx:click> 
  151.     mx:Button> 

其實Flex做應用開發效率還是挺高的,特別當你熟了MXML后基于不用在UI設計器和MXML間切換所帶來的麻煩。由于Flex直接支持CSS文件來描述,所以在開發過程基本不用管樣式,到***把設計人員搞好的CSS直接引用到Application里即可。順便推薦一個Flex的樣式主題站http://www.scalenine.com/gallery/ 提供一些免費的主題。Flex數據分頁查詢最終實現。

【編輯推薦】

  1. Flex教程 Flex程序開發初步
  2. Flex垃圾回收和性能優化的一些總結
  3. Flex和Jsp之間中文參數的傳遞
  4. Flex編程中需要注意的Namespace用法
  5. Flex SDK 4:Gumbo的主題 極其快速的RIA開發
責任編輯:彭凡 來源: cnblogs
相關推薦

2011-08-15 10:22:19

分頁查詢數據庫

2010-08-05 09:39:17

Flex頁面跳轉

2009-04-09 13:14:09

Oracle分頁查詢CBO

2010-07-30 09:16:24

Flex數據綁定

2010-08-11 16:10:27

Flex DataGr

2010-08-12 13:34:13

Flex驗證組件

2011-03-21 13:44:38

SQL ServerSQL Server2分頁

2010-07-29 15:09:19

Flex全屏

2010-08-12 10:43:19

Flex數據綁定

2009-08-04 14:23:36

ASP.NET查詢分頁

2009-09-21 13:42:47

Hibernate查詢

2010-11-10 15:29:40

SQL SERVER

2010-08-05 15:06:19

Flex數據綁定

2009-09-18 12:29:55

2010-08-04 10:42:08

Flex數據庫

2010-08-09 14:54:58

Flex全屏

2010-08-03 11:29:09

Flex全屏

2010-07-28 09:29:36

Flex DataGr

2009-07-28 16:07:40

.NET圖片快速處理

2010-11-09 13:09:58

SQL Server分
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久久精彩视频 | 欧洲精品码一区二区三区免费看 | 成人片在线看 | 日韩一级免费电影 | 欧美精品在线免费观看 | 亚洲免费在线 | 亚洲网站在线观看 | 欧美亚洲高清 | 一级黄色网页 | 久久久久久av | 亚洲 欧美 日韩在线 | 992tv人人草 久久精品超碰 | 国产精品免费一区二区三区四区 | 国产精品海角社区在线观看 | 日本免费小视频 | 午夜精品久久久久久久星辰影院 | 欧美一区两区 | 99re热精品视频 | 日韩视频在线播放 | 色婷婷国产精品综合在线观看 | 欧美亚州 | 日日人人 | 91精品国产综合久久婷婷香蕉 | 日日综合| 欧美激情久久久 | 午夜一区| 婷婷桃色网 | 国产视频三级 | 久久久久久成人 | 免费在线黄色av | 九九热热九九 | 国产精品视频网站 | 精品久久精品 | 一二三区在线 | 久久成人一区 | 在线观看av网站 | 精品久久一区 | chengrenzaixian| 国产欧美一区二区三区久久手机版 | 人人干免费 | www视频在线观看 |