Mate: Cafe Townsend example updated for using Flex 4
For an upcoming Flex 4 training I do need a good example for using Mate framework. At the moment you will find a lot of examples on Mate’s official website or at the project called “mate-examples” at Google Code. But it seems that there is not any Flex 4 example available.
Anyway, I just ported the current Cafe Townsend example (Flex 3) created by Laura Arguello to Flex 4.
It was not a big deal, because Mate supports already Flex 4. Only few changes was necessary for using new Spark components.
Also I did some little modifications in MainEventMap.mxml to start all Inject properties for any views as soon as possible listening to FlexEvent.PREINITIALIZE. Furthermore all presentation models now are not created before its view will be added. But that is what we called “cosmetic”
, because Laura has already done an awesome job building the Flex 3 example of Cafe Townsend!
Live example
[Update 03/15/2010] For a better use case of Flex 4 I have refactored the original code of the app. Now it based on a new layout and uses some effects. Last but not least the code implement a LocalEventMap to encapsulate the handling of employes, which is important if you want to use a modular app with Flex-Modules[/Update]
(To view source code just a right mouse click on the app)
Source code available
You will find the full source of Mate’s Cafe Townsend Flex 4 example at the project called ‘mate-examples’ on Google Code.
Have fun!
-Jens
This is a great example. I guess using this pattern would be very fast to connect to a remote service and get the data from a mysql-db instead the XML. I did this with Flex3 and Zend AMF using a services-config.xml to get and save VOs. What is the correct way to do it with all the new Data/Service features of FB4.
I did find the answer in this excellent tutorial
http://www.insideria.com/2010/05/flex-4-php-data-centric-soluti.html
I’m getting thye follwoing error when i compile the code in FB4 (SDK 4.1)
Error #1085: The element type “link” must be terminated by the matching end-tag “”.” faultCode=”Client.CouldNotDecode” faultDetail=”null”]
at mx.rpc.http::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\http\AbstractOperation.as:1025]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:313]
at mx.rpc::Responder/result()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:84]
at DirectHTTPMessageResponder/completeHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:446]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
Please assist me.
New to flex and mate and would love to see this example connect with data from a data base. Any one have a copy????