The example for the Getting Started guide. It shows:
- How to handle a custom event in the Event Map
- How to use the view Injectors to get the data from the Model Manager
RemoteObject version
This is the version described in the Getting Started guide. It uses RemoteObject to call a ColdFusion service. The backend could be changed to other AMF implementation such as Java as long as the service returns a numeric value.
WebService version
We have also created a version of this example that does not require ColdFusion. It calls the Stock Quotes web service directly. Because of that, it also has an additional class that parses the data before passing it to the QuoteManager class that stores it. In order to that, we added a MethodInvoker tag between the <resultHandlers> tag and the MethodInvoker tag that called the QuoteManager.
<br /><div id="inlineExample"> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject('/assets/content/examples/stockQuoteExample/StockQuoteExample.swf', 'website', '400', '200', '9', '#FFFFFF'); so.useExpressInstall('/assets/scripts/swfobject/expressinstall.swf'); so.addParam('menu', 'false'); so.write('inlineExample'); // ]]> </script> </div>
Sorry about that. I've updated the zip, I hope it works now.
By the way, were you the person that came to me before the session?
This is very interesting stuff, much easier to follow than cairngorm so far... But I do have one simple question?
I'm unsure of how the program flow works withinthe result handlers.
Does each MethodInvoker get called in sequence? And how the result of QuoteSericeParser is passed along to QuoteManager. I can see hints in the code such as lastReturn.lastPrice, but I'd just like a bit of clarification on this point if possible?
Many thanks,
Matt Law
<resultHandlers>
<!-- parse the results -->
<MethodInvoker generator="{QuoteServiceParser}" method="parseQuoteResults"
arguments="{resultObject}" cache="false" />
<!-- store the last price from the parsed results -->
<MethodInvoker generator="{QuoteManager}"
method="storeQuote" arguments="{lastReturn.lastPrice}"/>
</resultHandlers>
In situations that instances of QuotePanel are created in runtime, targetId won't work, since the ids would be dynamic.
See the Hello World example to do what you need (using the CallBack tag and without using targetId).