| By Nahuel Foronda, Laura Arguello | Article Rating: |
|
| January 27, 2006 01:45 PM EST | Reads: |
31,546 |
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation.
That alone made Flash Forms appealing - and with the addition of pieces of ActionScript code, developers were able to create truly responsive forms. But because they were meant to be compatible with HTML forms, they still shared the same submit-refresh model. What if you could "submit" the form and, without a page refresh, get feedback from the server?
Enter Flash Remoting. In this series of tutorials you will learn how to create an application that allows users to search and retrieve records from a database, and then edit, add, and remove them from the database - all in one screen. Those functions will be presented in the context of a sample application, a real state management system that administers listings of properties for sale.
In Part 1 of this series, you will build the search functionality in the application.
Requirements
To complete this tutorial you will need to install the following software and files:
- ColdFusion MX 7.01
For a trial download go to www.macromedia.com/cfusion/tdrc/index.cfm? product=coldfusion&promoid=devcenter_tutorial_product_090903. To buy go to www.macromedia.com/software/coldfusion/buy/ ?promoid=devcenter_tutorial_coldfusion_090903. To get the updater go to www.macromedia.com/support/coldfusion/downloads_updates.html#mx7. - Database: Microsoft Access, SQL Server, or MySQL
- Tutorials and sample files: http://download.macromedia.com/pub/developer/realestate.zip. To install the sample application on your computer, unzip the files, create a data source called realEstate in the ColdFusion Administrator, and then browse to the directory after you place the files. Read the full instructions in the Readme file.
Basic knowledge of ColdFusion components and Flash Forms and the ability to set up a data source and write simple SQL statements.
Overview of the Real Estate Management System Sample Application
This article focuses on the search functionality of the sample application (see Figure 1).
When you open the application, a small panel on the left lets users search for a property by specifying search criteria, such as number of bedrooms or price range. The matching properties appear in a data grid in the upper-right panel, and when a user selects a property, the details appear in the lower-right panel (see Figure 2).
In the following sections you will do the following:
- Create the search form.
- Write a component to make the search query.
- Create a Flash Remoting service that handles the search request.
- Call the Flash Remoting service and show the results in a datagrid
The whole application user interface is one Flash Form. As such, its contents are within the cfform tag:
<cfform format="flash" name="RealEstateAdmin">
<!--- form content --->
</cfform>
The only necessary attribute of the cfform tag is the format="flash" attribute to create a Flash Form. By assigning a name to the form, you will have a named scope that you can use later. You can also set the form's dimensions by using the width and height attributes.
Note: If you are familiar with the process of defining a simple Flash Form, you can skip this section.
The Search panel (see Figure 3) contains several controls, all of them enclosed in a cfformgroup tag with a type attribute of "panel":
<cfformgroup type="panel" label="Search" height="440" >
<!--- controls --->
</cfformgroup>
These are the controls contained within the Search panel:
- The cfselect tags for Price range, Bedrooms, Bathrooms, and Minimum footage that create pop-up menus. You can populate cfselect tags from option tags, queries, or a combination of the two, as shown in this example:
<cfselect name="search_priceRangeFrom"
query="priceRange"
display="label"
value="data"
queryposition="below">
<option value="0">No min.</option>
</cfselect>This cfselect tag uses a query called priceRange that contains two columns - data and label - which populate the search_priceRangeFrom select control. In addition, an extra option not present in the query ("No min.") is manually added using an option tag. The name you give each control is important because later you will need to reference the control name when you submit the form.
- <cfinput type="text"> tag for "MLS number", as follows:
<cfinput name="search_mls_id" type="text" />
- <cfinput type="radio"> tags for "Status." You need one cfinput tag for each type of listing status (Active, Sold, Back Up Offers, New Listing). Option button tags that belong to the same group must have the same name. See the following:
<cfinput type="radio" name="search_status" value="active" label="Active"/>
<cfinput type="radio" name="search_status" value="backUp" label="Back Up Offers"/>
<cfinput type="radio" name="search_status" value="sold" label="Sold"/> - <cfinput type="checkbox"> tags for "Amenities." You need one tag for each type of amenity (Pool, Laundry, Walk-in Closets, Fireplace). Unlike option buttons, each tag must have a different name, as follows:
<cfinput type="checkbox" name="search_hasPool" label="Pool"/>
<cfinput type="checkbox" name="search_hasLaundry" label="Laundry"/>
<cfinput type="checkbox" name="search_hasFireplace" label="Fireplace"/> - <cfformitem type="text"> tags for additional labels or titles, as follows:
<cfformitem type="text" style="fontWeight:bold;">Status: </cfformitem>
- <cfinput type="button"> tag for the Search button:
<cfinput type="button" name="search_submitBtn" value="Search" />
This small section of the application does not do anything yet. It only accepts user input of standard form controls: text inputs, option buttons, check boxes, and selects. At this point, you would normally add a Submit button to submit the form for processing on the server. But don't do that yet - wait just a moment and complete the following sections.
Published January 27, 2006 Reads 31,546
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Nahuel Foronda
Nahuel Foronda is one of the founders of Blue Instant (http://www.blueinstant.com), a web development firm specializing in Rich Internet Applications where he has been creating award-winning applications and offering training for the last five years. He also maintains a blog, called AS Fusion (http://www.asfusion.com), where he writes about Flash, ColdFusion and other web technologies.
More Stories By Laura Arguello
Laura Arguello is one of the founders of Blue Instant (http://www.blueinstant.com), a web development firm specializing in Rich Internet Applications where she has been creating award-winning applications and offering training for the last five years. She also maintains a blog, called AS Fusion (http://www.asfusion.com), where she writes about Flash, ColdFusion and other web technologies.
![]() |
SYS-CON Belgium News Desk 01/27/06 02:58:22 PM EST | |||
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation. |
||||
![]() |
SYS-CON Netherlands News Desk 01/27/06 02:33:25 PM EST | |||
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation. |
||||
![]() |
SYS-CON India News Desk 01/27/06 12:09:13 PM EST | |||
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation. |
||||
![]() |
SYS-CON Italy News Desk 01/27/06 11:05:16 AM EST | |||
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation. |
||||
![]() |
SYS-CON India News Desk 01/27/06 10:17:12 AM EST | |||
With the release of Macromedia ColdFusion 7 and the arrival of Flash Forms, developers were presented with an alternative to HTML forms that offered them additional functionality, such as full-featured controls not available in HTML and built-in validation. |
||||
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe Reader Sued
- 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 Cans Another 9% of its Workforce
- Adobe Betas Target RIAs and Cloud Computing
- Adobe MAX 2009 Online
- Thinking of Flex in London
- Moyea DVD4Web Converter V2.0 Converts DVD to FLV Fast and Synchronously with Watermarks
- Adobe & Salesforce Cut Cloud Deal
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Is Microsoft as Free as Open Source?
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- 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
- Bruce Chizen Joins Voyager Capital as Venture Partner
- My Top Seven Wishes From Adobe MAX 2009
- Adobe Flex Developer Earns $100K in New York City
- 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




































