0 Replies Latest reply on Sep 10, 2012 11:11 AM by qprioleau

    dropDownList.selectedItem Issues

    qprioleau

      Hello,

       

       

          I am new to Adobe Flex -> MAMP, and was wondering if someone could help me out. I have a datagrid using php to pull data from mysql, and would like to use the dropDownList.selectedItem change action to change the datagrid's information. The php is looking for itemID:int and I have provided it with the dropDownList's RecordID, but I keep getting the below error message and can't figure it out. Can someone help me please?

       

       

      TypeError: Error #1034: Type Coercion failed: cannot convert valueObjects::Records@11148dcf1 to mx.collections.IList.

          at Function/<anonymous>()[/Users/Qdprioleau/Websites/FService/FieldReporter/src/FieldReporte r.mxml:276]

          at Function/http://adobe.com/AS3/2006/builtin::apply()

          at mx.binding::Binding/wrapFunctionCall()[E:\dev\4.y\frameworks\projects\framework\src\mx\bi nding\Binding.as:395]

          at mx.binding::Binding/innerExecute()[E:\dev\4.y\frameworks\projects\framework\src\mx\bindin g\Binding.as:469]

          at Function/http://adobe.com/AS3/2006/builtin::apply()

          at mx.binding::Binding/wrapFunctionCall()[E:\dev\4.y\frameworks\projects\framework\src\mx\bi nding\Binding.as:395]

          at mx.binding::Binding/execute()[E:\dev\4.y\frameworks\projects\framework\src\mx\binding\Bin ding.as:333]

          at mx.binding::Binding/watcherFired()[E:\dev\4.y\frameworks\projects\framework\src\mx\bindin g\Binding.as:511]

          at mx.binding::Watcher/notifyListeners()[E:\dev\4.y\frameworks\projects\framework\src\mx\bin ding\Watcher.as:311]

          at mx.binding::PropertyWatcher/eventHandler()[E:\dev\4.y\frameworks\projects\framework\src\m x\binding\PropertyWatcher.as:377]

          at flash.events::EventDispatcher/dispatchEventFunction()

          at flash.events::EventDispatcher/dispatchEvent()

          at mx.rpc::CallResponder/set lastResult()

          at mx.rpc::CallResponder/result()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\CallResponde r.as:120]

          at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AsyncToken.as:239]

          at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\events\ResultEvent.as:207]

          at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::dispatchResultEvent()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\da ta\ConcreteDataService.as:3715]

          at mx.data::DataListRequestResponder/result()[C:\depot\DataServices\branches\milestone\lcds4 5_fb45\frameworks\projects\data\src\mx\data\DataListRequestResponder.as:154]

          at mx.data::RPCDataServiceAdapter/sendResultEvent()[C:\depot\DataServices\branches\milestone \lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1593]

          at mx.data::RPCDataServiceAdapter/getItemResult()[C:\depot\DataServices\branches\milestone\l cds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1634]

          at mx.collections::ItemResponder/result()[E:\dev\4.y\frameworks\projects\framework\src\mx\co llections\ItemResponder.as:129]

          at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AsyncToken.as:239]

          at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\events\ResultEvent.as:207]

          at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.as:244]

          at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:318]

          at mx.rpc::Responder/result()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]

          at mx.rpc::AsyncRequest/acknowledge()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AsyncReq uest.as:84]

          at NetConnectionMessageResponder/resultHandler()[E:\dev\4.y\frameworks\projects\rpc\src\mx\m essaging\channels\NetConnectionChannel.as:552]

          at mx.messaging::MessageResponder/result()[E:\dev\4.y\frameworks\projects\rpc\src\mx\messagi ng\MessageResponder.as:235]

       

       

      Here is the code:

       

      for the dataGrid:

      <s:DataGrid id="dataGrid" includeIn="DataViewer" x="10" y="97" color="#041608"
                      creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4"
                      selectedIndex="1">
              <s:columns>
                  <s:ArrayList>
                      <s:GridColumn dataField="RecordsID" headerText="RecordsID"></s:GridColumn>
                      <s:GridColumn dataField="PublisherID" headerText="PublisherID"></s:GridColumn>
                      <s:GridColumn dataField="ServiceDay" headerText="ServiceDay"></s:GridColumn>
                      <s:GridColumn dataField="Books" headerText="Books"></s:GridColumn>
                      <s:GridColumn dataField="BletsBroc" headerText="Brochures"></s:GridColumn>
                      <s:GridColumn dataField="Hours" headerText="Hours"></s:GridColumn>
                      <s:GridColumn dataField="Mags" headerText="Mags"></s:GridColumn>
                      <s:GridColumn dataField="RVs" headerText="RVs"></s:GridColumn>
                      <s:GridColumn dataField="BibleStudies" headerText="BibleStudies"></s:GridColumn>
                      <s:GridColumn dataField="RBC" headerText="RBC"></s:GridColumn>
                  </s:ArrayList>
              </s:columns>
              <s:typicalItem>
                  <fx:Object BibleStudies="BibleStudies1" BletsBroc="BletsBroc1" Books="Books1"
                             Hours="Hours1" Mags="Mags1" PublisherID="PublisherID1" RBC="RBC1"
                             RecordsID="RecordsID1" RVs="RVs1" ServiceDay="ServiceDay1"></fx:Object>
              </s:typicalItem>
              <s:AsyncListView id="dgList" list="{getRecordsByIDResult.lastResult}"/>