Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion, Adobe Flex

ColdFusion: Article

ColdFusion To Flex Super Wizard

Building Cool Applications

ColdFusion Extensions for Flex, included in ColdFusion MX 7.0.2, enable Flex Builder 2.0 developers to automate the more mundane tasks like CRUD (creating, reading, updating and deleting records) by creating ColdFusion components, ActionScript class files, and code to invoke a Web Service.

In this article we will use the ColdFusion/Flex Application wizard to automatically generate Master, Detail and Master/Detail pages that will let the user create, read, update and delete artist information supplied from a database. The application will include ColdFusion Components, Flash ActionScript classes, as well as Flex MXML pages. Special thanks to Damon Cooper and Dean Harmon for helping me better understand the CF/Flex Super Wizard.

First we have to make sure we have all the software we need to make our software writing jobs easier.

The following software will be used in this example:

  1. Windows XP Home Edition (the operating system I am using)
  2. Java2Runtime Environment Std Edition 1.4.2.12 (needed to run Eclipse)
  3. Eclipse SDK 32win32 (the tool we will be using to develop in)
  4. Flex Builder 2.0 with Charting (this contains the CFFlex Wizard)

    Please see my previous article "My First Flex App" in September CFDJ (Vol. 8, Issue 9) for instructions on how to install Flex Builder and Eclipse.

  5. ColdFusion MX 7.0.2 (contains the ColdFusion Extensions for Flex Builder)

    To install the ColdFusion Extenstions for Flex Builder (in Flex Builder):
    A) Select Help > Software Updates > Find and Install.
    B) Select the Search for New Features and Install option, click Next.
    C) Click New Archive Site.
    D) Select the ColdFusion_Flexbuilder_Feature.zip file, click Open.
    (If you installed CF MX 7.0.2 using the default values, look in the Extras Folder.)
    E) When the Edit Local Site dialog box appears, click OK.
    F) Ensure the ColdFusion Flex Builder feature is selected, then click Finish.
    G) Select the check box next to ColdFusion_Flexbuilder_Feature.zip, then click Next.
    H) Accept the terms of the license, then click Next.
    I) Click Finish.
    J) Click Install All.
    K) When the installation is complete, click to restart Flex Builder.

  6. Lastly, make sure RDS is set up correctly to allow ColdFusion to access the database you will be using. To configure RDS in Flex Builder:
    A) Select Window > Preferences > RDS Configuration
    B) I will be using the default localhost server in this example:
  • Select localhost
  • Enter Description
  • Host Name 127.0.0.1
  • Port Number 8500 (if you are using the built in web server)
  • I won't be using the Context Root.
  • RDS password
    C) To Test the connection, select the server, then click Test Connection.
    D) To view files in Flex Builder, select Window > Other Views, RDS, RDS Fileview to select files or RDS Dataview to select data sources.
  1. Please reference the livedocs for more information on setting up the ColdFusion extensions and RDS in Eclipse to use ColdFusion with Flex: http://download.macromedia.com/pub/documentation/en/flex/2/using_cf_with_flex2.pdf
Once everything is installed, we are ready to use the CFFlex Wizard to create an application. This application demonstrates how you can use the CFFlex Wizard and Flex Builder 2.0 to "automatically" create a Master, Detail, and Master/Detail page to create, read, update, and delete artist information along with their specific pieces of art. As you will see, the CFFlex Wizard will generate Flex, Flash and ColdFusion pages for you. Read on and be amazed!

To Create the application while in Eclipse, select CTRL + N and select the ColdFusion/Flex application wizard (see Figure 1).

Press Next and read through text displayed. Press Next again (see Figure 2).

Since this is a new application we will click Next to specify our settings. (If we wanted to load settings from a previous application, we could just select the "Load ColdFusion/Flex Application Wizard Settings" button instead) (see Figure 3).

Select your RDS Server where your Data Source is located, then select the Data Source being used in your application. Press Next. (ColdFusion uses RDS to get the metadata from your Data Source here) (see Figure 4).

This is where we will define the Page Layout and Design for our first page (see Figure 5).

We will select "Master" for the Master Page Type. This will generate a page that just lists information. Then select the "Edit Master Page" button (see Figure 6).

Select the artists table from the list of tables on the left (see Figure 7).

Select from the artists table the ARTISTID, FIRSTNAME and LASTNAME. Click Save (see Figure 8).

Enter "List of Artists" next to the Name: label to name the page. Select + to Add the next page (see Figure 9).

Name the page Artist Detail and select "Detail" as a Page Type then select the "Edit Detail Page" button (see Figure 10).

Double-click the artists table. This time the wizard automatically ties the artists to the ARTISTID as indicated by the "ID" parameter (see Figure 11).

Next we add the two pages to the Navagation Tree to the left. Select Next (see Figure 12).

Here we can change settings that could affect the Flash Remoting settings; the Web Root URL settings; the Project Name and Web Root Folder, where the Project will be placed; as well as the Wizard Settings. This time we will accept the default settings, so click Finish (see Figure 13).

The wizard makes the ArtExample project, then compiles it! Automatically created is the ColdFusion code (as seen by the ColdFusion components on the left) as well as the Flex code (as seen by the Main.mxml Source code on the right). WOW! That's what I thought when I saw this! (see Figure 14).

Here, we just double-clicked on the List_of_Artists.cfc to look inside at the query (see Figure 15).


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.

Comments (1)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...