ITeye博客

Flex

共 14 篇文章

Flex4: How to Create Checked List ComboBox?

1. ComboCheck.as /* * ComboCheck * v1.2.6 * Arcadio Carballares Martín, 2009 * http://www.carballares.es/arcadio */ package com.arcadiocarballares { import flash.events.Event; import flash.events.MouseEvent; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.controls.ComboBo…

2014-03-04 11:23 · Flex · Flex4

Flex4: How to Use Validator(Part I)

1. A simple example for static bind validator <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <mx:StringValidator i…

2013-10-08 19:22 · Flex · Flex · Validator

Flex4: How to Upload File to Servlet (Part II)

1. In this part, we focus on server side programming: 1) At what format did the data sent from Flex? 2) How did Servlet get data sent from Flex? 3) How did Servlet send response to Flex to notify upload finished? 4) How to make it easier for common file upload? 2. Use commons-io-2.4.jar and commons…

2013-04-23 23:00 · Flex · Flex · Servlet · file upload

Flex4: How to Upload File to Servlet (Part I)

1. Flex <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="initApp(event)" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elem…

2013-04-23 22:11 · Flex · Flex · Tomcat · Servlet · file upload

Flex: Simple Components Introductions & Examples

1. PopUpWindow <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value…

2013-04-12 15:09 · Flex · Flex · Components

Flex: How to customize header renderer and column renderer for DataGrid?

1. Main Application <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" preinitialize="init();" minWidth="955" minHeight="600"> <fx:Declarations> <!-- Place non-visual el…

2013-04-09 13:54 · Flex · Flex · datagrid · itemrenderer

Flex: DataBinding in depth (Part Four)

Flex Data Binding Pitfalls and Common Misuse Mistakes 1. Using [Bindable] When Binding Is Not Necessary <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955"…

2013-04-08 19:11 · Flex · Flex · data binding

Flex: DataBinding in depth (Part Three)

1. Normal Data Binding for VO package vo { [Bindable] public class Student { public var id:int; public var name:String; public var gender:String; public function Student(id:int, name:String, gender:String) { this.id = id; this.name = name; this.gender = gender; } } } <?xml version="1.0" encoding="u…

2013-04-08 18:36 · Flex · Flex · data binding · bindable

Flex: DataBinding in depth (Part Two)

1. Implicit Data Binding & Explicit Data Binding //The main difference between implicit and explicit is that implicit data binding is //done at run time while explicit data binding is done at compile time 1). Implicit Data Binding: Eg1. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx…

2013-04-08 17:15 · Flex · Flex · Vector · data binding · explicit · implicit

Flex: DataBinding in depth (Part One)

1. One-way binding & Two-way binding 1) One-way binding: Source ->Destination, once source changed, destination will change accordingly. 2) Two-way binding: Source<->Destination, once source changed, destination will change and vice versa. Eg. 1)One-way binding <?xml version="1.0" encoding="utf-8"?…

2013-04-08 16:34 · Flex · Flex

Flex: How to specify DataGrid sortFunction and Code refractor

1. The previous article about data grid sort function that still have problems about code refractor. http://davyjones2010.iteye.com/blog/1840335 2. Below are solutions for a cleaner code with code refractor. 1. Vo (Compare functions are now moved from main application to value object. A better appr…

2013-04-04 14:03 · Flex

Flex: How to specify DataGrid sortFunction and disable default sortFunction

Requirements: 1. Set the first column of the data grid to be checkbox, indicating we can select one or more specific rows. 2. Once we clicked the header, then the data grid can be sorted by the clicked column, if there are same item in this column indicating that returns 0, we use the id column whi…

2013-04-01 19:44 · Flex · Flex · datagrid

Flex: How to use a custom Event

1. Declare a custom Event that extends Event and have some properties for data transfer purpose. 2. Declare the custom Event in component/application's metadata block 3. In the declared component/application, dispatch the custom event under specific circumstance. 4. Use the component in outter comp…

2013-03-29 18:38 · Flex · Flex · event

Flex: How to create a custom Event

1. Create a subclass that extends the flash.events.Event base class 2. Add properties to the subclass to hold the data you want to dispatch 3. Create the event class's constructor: 3.1 Invoke the super() method of the Event class within the constructor, passing the event type to it 3.2 Populate the…

2013-03-29 14:01 · Flex · Flex