Hi all.  I went to the Adobe Intro to Flex training for CF developers
this past weekend in Durham.  With all this new found goodness, I
wanted to try it out on one of my MG apps.

I'm running CF9, lastest MG3, Flex 4.  The current MG3 app is
functioning correctly.

 I followed the instructions for using the MG remoting service cfc and
getting the following error.

ReferenceError: Error #1065: Variable stuff is not defined.
        at global/flash.utils::getDefinitionByName()
        at mx.utils::DescribeTypeCache$/describeType()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\utils
\DescribeTypeCache.as:106]
        at mx.utils::ObjectUtil$/getClassInfo()[E:\dev\gumbo_beta2\frameworks
\projects\framework\src\mx\utils\ObjectUtil.as:944]
        at mx.controls::DataGrid/generateCols()[E:\dev\gumbo_beta2\frameworks
\projects\framework\src\mx\controls\DataGrid.as:2696]
        at mx.controls::DataGrid/collectionChangeHandler()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\controls\DataGrid.as:
4560]
        at mx.controls.listClasses::ListBase/set dataProvider()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\controls\listClasses
\ListBase.as:2267]
        at mx.controls::DataGrid/set dataProvider()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\controls\DataGrid.as:
1615]
        at eFlex/_eFlex_DataGrid1_c()[D:\Users\braines\Eclipse\workspace\eFlex
\src\eFlex.mxml:5]
        at eFlex/_eFlex_Array1_c()
        at mx.core::DeferredInstanceFromFunction/getInstance()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\core
\DeferredInstanceFromFunction.as:105]
        at spark.components::SkinnableContainer/createDeferredContent()[E:\dev
\gumbo_beta2\frameworks\projects\spark\src\spark\components
\SkinnableContainer.as:845]
        at spark.components::SkinnableContainer/createContentIfNeeded()[E:\dev
\gumbo_beta2\frameworks\projects\spark\src\spark\components
\SkinnableContainer.as:877]
        at spark.components::SkinnableContainer/createChildren()[E:\dev
\gumbo_beta2\frameworks\projects\spark\src\spark\components
\SkinnableContainer.as:685]
        at mx.core::UIComponent/initialize()[E:\dev\gumbo_beta2\frameworks
\projects\framework\src\mx\core\UIComponent.as:6874]
        at spark.components::Application/initialize()[E:\dev
\gumbo_beta2\frameworks\projects\spark\src\spark\components
\Application.as:783]
        at eFlex/initialize()
        at mx.managers.systemClasses::ChildManager/childAdded()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\managers
\systemClasses\ChildManager.as:176]
        at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\managers
\SystemManager.as:2808]
        at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/
internal::kickOff()[E:\dev\gumbo_beta2\frameworks\projects\framework
\src\mx\managers\SystemManager.as:2623]
        at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/
internal::preloader_completeHandler()[E:\dev\gumbo_beta2\frameworks
\projects\framework\src\mx\managers\SystemManager.as:2532]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.preloaders::Preloader/timerHandler()[E:\dev
\gumbo_beta2\frameworks\projects\framework\src\mx\preloaders
\Preloader.as:530]
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()

Here is the relevant code:

my xmxl file:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/halo" 
minWidth="1024"
minHeight="768"
                           creationComplete="init()">
        <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) 
here
-->
                <mx:RemoteObject id="mgrs"
                                                 destination="ColdFusion"
                                                 
source="eRequest.RemotingService"
                                                 result="resultHandler(event)"
                                                 showBusyCursor="true" />
        </fx:Declarations>

        <s:layout>
                <s:VerticalLayout paddingTop="10" paddingBottom="10"
horizontalAlign="center" />
        </s:layout>

        <fx:Script>
                <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.rpc.events.*;

                [Bindable]
                public var stuff:ArrayCollection;

                public function init():void{

                //call Model-Glue Remoting Service cfc
                mgrs.executeEvent("requests.ListRequests",{},"qryRequests");
                }

                public function resultHandler(event:ResultEvent):void{
                stuff = event.result.qryRequests as ArrayCollection;
                }

                ]]>
        </fx:Script>
        <mx:DataGrid dataProvider="stuff" width="90%">
                <mx:columns>
                        <mx:DataGridColumn headerText="Request Number"
dataField="RequestNum"/>
                </mx:columns>
        </mx:DataGrid>
</s:Application>

My event handler:

                <event-handler name="requests.ListRequests" 
type="templatedPage">
                        <broadcasts>
                                <message name="requests.ListRequests"/>
                        </broadcasts>
                        <results/>
                        <views>
                                <name name="body" 
template="requests/ListRequests.cfm">
                                        <argument name="xe.list" 
value="requests.ListRequests"/>
                                        <argument name="xe.edit" 
value="requests.EditRequest"/>
                                </name>
                        </views>
                </event-handler>

My controller:

        <cffunction name="getRequests" output="false" hint="I am a message
listener function generated for the ""requests.ListRequests"" event.">
                <cfargument name="event" />

                <cfset arguments.event.setValue
("qryRequests",beans.requestService.getRequests()) />
        </cffunction>

Any ideas of what might be happening?  In the debugging I see
references to "http://www.adobe.com/2006/flex/mx"; though the namespace
that is being used is "http://ns.adobe.com/mxml/2009";.  Not sure if
that means anything.

Thanks in advance

byron
--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to