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

實現(xiàn)Flex數(shù)據(jù)分頁查詢的幾種處理方法

開發(fā) 后端
這段時間空閑的時候都在用Flex結(jié)合自己開發(fā)的框架做一些應(yīng)用,在這里介紹一下如何進(jìn)行Flex數(shù)據(jù)分頁查詢,順便介紹一下Flex結(jié)合框架進(jìn)行應(yīng)用開發(fā)。

首先看下Flex數(shù)據(jù)分頁查詢需要的應(yīng)用效果<!--[if !vml]-->

Flex數(shù)據(jù)分頁查詢效果

<!--[endif]-->

實際功能包括對Customer進(jìn)行條件和Flex數(shù)據(jù)分頁查詢,客戶相關(guān)國家數(shù)據(jù)查詢。

  1. <!--[if !supportLists]-->l        <!--[endif]-->服務(wù)端功能處理  
  2. <!--[if !supportLists]-->u     <!--[endif]-->根據(jù)邏輯定義相關(guān)數(shù)據(jù)操作實體類  
  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調(diào)用方法生成工具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調(diào)用方法生成工具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]-->設(shè)置國家Combox數(shù)據(jù)源綁定  
  102. <mx:ComboBox id="txtCountry"  dataProvider="{Countrys}"    
  103. labelField="Name" editable="true" width="135"   
  104. color="#000000">mx:ComboBox> 
  105. <!--[if !supportLists]-->u     <!--[endif]-->設(shè)置客戶查詢數(shù)據(jù)源綁定  
  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]-->在界面初始化事件中定義相關(guān)方法加調(diào)處理  
  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]-->查詢按鈕相關(guān)功能處理  
  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做應(yīng)用開發(fā)效率還是挺高的,特別當(dāng)你熟了MXML后基于不用在UI設(shè)計器和MXML間切換所帶來的麻煩。由于Flex直接支持CSS文件來描述,所以在開發(fā)過程基本不用管樣式,到***把設(shè)計人員搞好的CSS直接引用到Application里即可。順便推薦一個Flex的樣式主題站http://www.scalenine.com/gallery/ 提供一些免費(fèi)的主題。Flex數(shù)據(jù)分頁查詢最終實現(xiàn)。

【編輯推薦】

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

2011-08-15 10:22:19

分頁查詢數(shù)據(jù)庫

2009-04-09 13:14:09

Oracle分頁查詢CBO

2010-08-05 09:39:17

Flex頁面跳轉(zhuǎn)

2010-07-30 09:16:24

Flex數(shù)據(jù)綁定

2010-08-11 16:10:27

Flex DataGr

2010-08-12 13:34:13

Flex驗證組件

2011-03-21 13:44:38

SQL ServerSQL Server2分頁

2009-08-04 14:23:36

ASP.NET查詢分頁

2010-08-12 10:43:19

Flex數(shù)據(jù)綁定

2010-07-29 15:09:19

Flex全屏

2009-09-21 13:42:47

Hibernate查詢

2010-11-10 15:29:40

SQL SERVER

2010-08-05 15:06:19

Flex數(shù)據(jù)綁定

2009-09-18 12:29:55

2010-08-04 10:42:08

Flex數(shù)據(jù)庫

2010-11-09 13:09:58

SQL Server分

2010-07-28 09:29:36

Flex DataGr

2010-08-09 14:54:58

Flex全屏

2019-11-15 10:01:07

MySQL數(shù)據(jù)庫數(shù)據(jù)

2009-07-28 16:07:40

.NET圖片快速處理
點贊
收藏

51CTO技術(shù)棧公眾號

主站蜘蛛池模板: 91精品国产91久久久久久最新 | 色婷婷精品久久二区二区蜜臂av | 91xxx在线观看 | 久久久精品 | 亚洲精品一区在线观看 | 亚洲午夜精品视频 | 成人在线视频网 | 日韩在线电影 | 日本视频中文字幕 | h片在线看| 精品久久久久国产免费第一页 | 欧洲av在线 | 男女羞羞视频免费看 | 色综合天天综合网国产成人网 | 国产极品91 | 中文字幕在线不卡 | 久久专区 | 91夜夜夜| 欧美日韩一区二区视频在线观看 | 国产欧美一区二区三区在线看 | 国产精品日韩一区二区 | 国产在线观看网站 | 激情综合五月天 | 久久久av中文字幕 | 黄视频免费 | 日本免费在线观看视频 | 91超碰caoporn97人人 | 国产你懂的在线观看 | 久久99精品久久 | 北条麻妃av一区二区三区 | 久久精品福利 | 成人免费大片黄在线播放 | 成人性视频免费网站 | 欧美日韩成人影院 | 色视频网站 | 欧美日韩1区 | 99久久婷婷国产综合精品电影 | 99久热 | 午夜av在线| 欧美激情视频一区二区三区在线播放 | 91在线精品秘密一区二区 |