Configuring an Application to Work Locally


From this lesson forward, you will be using the local ColdFusion server for all data and remote objects that the application will use. With ColdFusion started and running, the next set of steps will have you update the application to point all the <mx:HTTPService> tags to the local ColdFusion server.

Note

See the appendix, "Setup Instructions," for instructions on how to install and start the ColdFusion server. The instructions will have you configure ColdFusion to receive requests from Flex to retrieve, add, and update data. You must have ColdFusion set up from this point forward to run the lessons.


1.

If you have not done so already, start your local ColdFusion server.

If your ColdFusion server is installed according to the "Setup Instructions" in the appendix, you can start the server by executing the command "jrun -start cfusion" from a command prompt in the driveroot\cfusionFlexTFS\bin directory. If you are using Windows, be sure to leave the command prompt open, but minimized, while using the server.

2.

Open Dashboard.mxml.

Alternately, you can open Dashboard.mxml from your Lesson17/start directory and save it to your flexGrocer directory.

3.

Replace each incidence of http://www.flexgrocer.com/ in the url attribute of each <mx:HTTPService> tag with http://localhost:8300/flexGrocer/xml/.

<mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ rawSalesData.xml"   result="salesRPCResult(event)"   fault="showFault(event)"/> <mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ categorySalesData.xml   result="typeRPCResult(event)"   fault="showFault(event)"/> <mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ salesData.xml"   result="compRPCResult(event)"   fault="showFault(event)"/> <mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ category.xml   result="catHandler(event)"/> 


4.

Open DataEntry.mxml.

Alternately, you can open DataEntry.mxml from your Lesson17/start directory and save it to your flexGrocer directory.

5.

Replace each incidence of http://www.flexgrocer.com/ in the url attribute of each <mx:HTTPService> tag with http://localhost:8300/flexGrocer/xml/.

<mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ units.xml"   result="unitRPCResult(event)"/> 


6.

Open CategorizedProductManager.mxml from your managers directory.

Alternately, you can open CategorizedProductManager.mxml from your Lesson17/start/managers directory and save it to your flexGrocer/managers directory.

7.

Replace each incidence of http://www.flexgrocer.com/ in the url attribute of each <mx:HTTPService> tag with http://localhost:8300/flexGrocer/xml/.

<mx:HTTPService    url="http://localhost:8300/flexGrocer/xml/ categorizedProducts.xml"   result="prodByCategoryHandler(event)"   resultFormat="e4x"/> 


8.

Run the Dashboard, Data Entry, and Ecommerce applications. You should notice no difference in their functionality from what you saw at the end of Lesson 16.




Adobe Flex 2.Training from the Source
Adobe Flex 2: Training from the Source
ISBN: 032142316X
EAN: 2147483647
Year: 2006
Pages: 225

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net