| By Mary McDonald | Article Rating: |
|
| August 29, 2006 10:00 AM EDT | Reads: |
13,303 |
Change the label to Show Details.
Click on the Panel again. Under Flex Properties, locate the Layout area. Change the Layout of the Panel to Width = 400, Height = 200.
Locate the Add New State icon in the upper right corner. Click on it to Add a New State.
We'll call this state details. Type details in the Name field and press OK.
Change the Width on the details Panel to 500 and the Height to 400. Select the Button and delete it. Drag a new button component to the BarControl and change the label to Hide Details.
Click the Base State on the upper-right-hand corner. Click the button. In Flex Properties, under the Common area, Type currentState='details' next to On click to make the base state "transform" or turn into the details state.
Click the details State on the upper-right-hand corner. Click the button. In Flex Properties, under the General area, Type currentState=' ' next to Click to make the details state "transform" or turn back into the base state.
Click on the Base state and select the Source tab to display the source code for the Base state.
Flex uses MXML markup language. Your code should look similar to this.
Next, we will add some data to our panels using the HTTPService command to read an XML file located currently in your application bin folder. Copy the Catalog.xml file to your application's bin folder.
We're going to add three lines to our source code. The first line will define the service we'll be using.
Right above the states tags type:
<mx:HTTPService id="srv" url="catalog.xml"/>.
Next, define the container that will hold the data we're retrieving. Right before the mx:ControlBar tag type:
<mx:DataGrid width="100%" height="100%"dataProvider="{srv.result.catalog.product}"/>
Get the data when the application starts up by adding the following line to the mx:Application tag:
creationComplete="srv.send()"
Now save and run your application.
Press the Show Details Button.
Here the Details are displayed. Press the Hide Details button to return to the previous screen.
Congratulations! You've just built your first Flex application.
Click here for source code!
Published August 29, 2006 Reads 13,303
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Mary McDonald
Mary McDonald has served the last four years as the Northern Indiana Adobe Users Group Manager (see www.ninmug.org), has attended many conferences including CFUNITED, MAX, MXNorth and TodCon. Out of her 16 years working as a software developer, Mary has worked the last 6 years with ColdFusion, SQL, Flash, and Flex and is a Certified 5.0 ColdFusion Developer. Mary's other interests include music, photography, traveling, dogs, and most recently Tai Chi.
![]() |
George Lu 09/15/06 01:54:00 AM EDT | |||
Thanks! That's what I want. The original code with 'srv.result.catalog.product' has error. But where does 'lastResult' come from? >>> QUOTE: |
||||
![]() |
bigbadken 09/06/06 11:06:57 AM EDT | |||
Catalog.xml: It's located in the samples folder under the Flex Builder 2 Plug-in folder. For me, that was C:\Program Files\Adobe\Flex Builder 2 Plug-in\Flex SDK 2\samples\flexstore\data\catalog.xml. -FYI- <mx:DataGrid width="100%" height="100%" dataProvider="{srv.lastResult.catalog.product}"/> |
||||
![]() |
Greg C 09/04/06 05:28:19 PM EDT | |||
I can not find the Catalog.xml that I am suppose to copy to the BIN folder. The quote below says that it is currently in my Application folder.... nope... it is not... in fact I don't even have a bin folder. The walk through has be great until now when it refenced a file I can't find. Please send me the file... or let me know where I can download it, etc. >>> QUOTE: |
||||
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Adobe Cans Another 9% of its Workforce
- Moyea DVD4Web Converter V2.0 Converts DVD to FLV Fast and Synchronously with Watermarks
- Adobe Fiddles with its Web Apps
- Adobe & Salesforce Cut Cloud Deal
- Hosting.com Launches ColdFusion 9 in the Cloud
- The Real Time Infrastructure Ultimatum
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- The Planet Named “Bronze Sponsor” of Cloud Computing Expo
- Microsoft Expression Web Has Got Game
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Bruce Chizen Joins Voyager Capital as Venture Partner
- My Top Seven Wishes From Adobe MAX 2009
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- Constructing an Application with Flash Forms from the Ground Up
- AJAX World RIA Conference & Expo Kicks Off in New York City
- CFEclipse: The Developer's IDE, Eclipse For ColdFusion
- Personal Branding Checklist
- Adobe Flex 2: Advanced DataGrid
- Has the Technology Bounceback Begun?
- Building a Zip Code Proximity Search with ColdFusion
- i-Technology Viewpoint: We Need Not More Frameworks, But Better Programmers
- The Asynchronous CFML Gateway
- Web Services Using ColdFusion and Apache CXF



























