0 Replies Latest reply on Jan 6, 2012 9:00 PM by TommyReady

    Issues with Flash Builder 4.6 and RDS from CF Server

    TommyReady

      For starters I can't for the life of me figure out how to connect my Flash Builder 4.6 with my CF server that is NOT local but hosted elsewhere and I have RDS setup and works perfect.  I only see in Flash Builder where to set a local CF server.  Anyway, to get around that problem I use

       

      <s:RemoteObject id="myService" endpoint="http://dev.myURL.com/flex2gateway/" destination="ColdFusion" source="data">

              <s:method name="fetchData" result="handleResults(event)" />

      </s:RemoteObject>

       

      This code above lets me connect with no problem and I used trace(event) to see the results of my cfc method in the console.

       

      Anyway, the problem I am having now is that I want to take the results of my cfc method into a datagrid.  Here is the code below I am using.

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                           xmlns:s="library://ns.adobe.com/flex/spark"

                                                           xmlns:mx="library://ns.adobe.com/flex/mx">

       

                <fx:Script>

                          <![CDATA[

                                    import mx.rpc.events.ResultEvent;

                                    protected function button1_clickHandler(event:MouseEvent):void

                                    {

                                              myService.fetchData();

                                    }

       

                                    protected function handleResults(event:ResultEvent):void

                                    {

                                              trace(event.result);

                                    }

                          ]]>

                </fx:Script>

       

                <fx:Declarations>

                          <!-- Place non-visual elements (e.g., services, value objects) here -->

       

                          <s:RemoteObject id="myService" endpoint="http://dev.myURL.com/flex2gateway/" destination="ColdFusion" source="data">

                                    <s:method name="fetchData" result="handleResults(event)" />

                          </s:RemoteObject>

       

       

                </fx:Declarations>

                <s:Button id="test" x="56" y="42" label="Test" click="button1_clickHandler(event)"/>

                <s:DataGrid id="adminList" x="56" y="175" width="766" requestedRowCount="4">

                          <s:columns>

                                    <s:ArrayList>

                                              <s:GridColumn headerText="Admin ID" dataField="admin_id"></s:GridColumn>

                                              <s:GridColumn headerText="Last Name" dataField="last_name"></s:GridColumn>

                                              <s:GridColumn headerText="First Name" dataField="first_name"></s:GridColumn>

                                              <s:GridColumn headerText="Department" dataField="department_name"></s:GridColumn>

                                              <s:GridColumn headerText="Status" dataField="active"></s:GridColumn>

                                    </s:ArrayList>

                          </s:columns>

                </s:DataGrid>

      </s:WindowedApplication>

       

       

      What am I doing wrong?  Can anyone help?  Thanks!!!