adrock3000
01-18-2007, 04:47 PM
first and foremost i am web developer new to flex/actionscript/coldfusion. i have a java background but this language is new to me. i keep getting syntax errors and i am not sure what i need to do in this situation. i am trying to populate a datagrid with the results from a search to a mySQL db using cf and im pretty sure i have it for the most part im just not sure how to get the results from an "event" from what i was told the results where coming back in, to a object/array that i can bind as a dataprovider. right now i am getting an implicit coercion error from the results property of the webservice. this code is still in progress...sorry
any help anyone can give me would be greatly appreciated...tia
ps. i know theres a whole bunch of extra imports in there
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*">
<mx:Script>
<![CDATA[
import mx.events.ResizeEvent;
import mx.utils.ObjectProxy;
import mx.rpc.events.AbstractEvent;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import flash.utils.*;
import mx.rpc.events.*;
import mx.managers.PopUpManager;
import mx.core.IFlexDisplayObject;
import mx.controls.*;
import asFiles.*;
[Bindable]
public var searchObj:SearchConstructor;
private var searchWebService:SearchWebService;
private var searchResults:Array;
public function createObj()
{
searchWebService=new SearchWebService();
addChild(searchWebService);
searchObj = new SearchConstructor(searchCombo.text, searchInput.text)
searchWebService.myService.SearchWeb(searchObj.sea rchString, searchObj.searchField);
}
public function openWindow(event:ResultEvent)
{
searchResults = event;
}
]]>
</mx:Script>
<mx:WebService
id="jobBoardService"
wsdl="http://www.blah.com/JobBoard.cfc?wsdl"
showBusyCursor="true"
concurrency="multiple">
<mx:operation name="SearchWeb" result="openWindow(event)" resultFormat="object">
<mx:request>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Panel x="10" y="10" width="315" height="165" layout="absolute" title="Search">
<mx:Form x="10" y="10">
<mx:FormItem label="Search For:">
<mx:TextInput id="searchInput"/>
</mx:FormItem>
<mx:FormItem label="in:">
<mx:ComboBox id="searchCombo" dataProvider="[HONAME,ADDRESS,CITY,STATE,PHONE,ACCOUNT]">
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Search" id="srchButton" click="createObj()"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
<mx:DataGrid x="176.5" y="239" dataProvider="searchResults">
</mx:DataGrid>
</mx:Application>
any help anyone can give me would be greatly appreciated...tia
ps. i know theres a whole bunch of extra imports in there
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*">
<mx:Script>
<![CDATA[
import mx.events.ResizeEvent;
import mx.utils.ObjectProxy;
import mx.rpc.events.AbstractEvent;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import flash.utils.*;
import mx.rpc.events.*;
import mx.managers.PopUpManager;
import mx.core.IFlexDisplayObject;
import mx.controls.*;
import asFiles.*;
[Bindable]
public var searchObj:SearchConstructor;
private var searchWebService:SearchWebService;
private var searchResults:Array;
public function createObj()
{
searchWebService=new SearchWebService();
addChild(searchWebService);
searchObj = new SearchConstructor(searchCombo.text, searchInput.text)
searchWebService.myService.SearchWeb(searchObj.sea rchString, searchObj.searchField);
}
public function openWindow(event:ResultEvent)
{
searchResults = event;
}
]]>
</mx:Script>
<mx:WebService
id="jobBoardService"
wsdl="http://www.blah.com/JobBoard.cfc?wsdl"
showBusyCursor="true"
concurrency="multiple">
<mx:operation name="SearchWeb" result="openWindow(event)" resultFormat="object">
<mx:request>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Panel x="10" y="10" width="315" height="165" layout="absolute" title="Search">
<mx:Form x="10" y="10">
<mx:FormItem label="Search For:">
<mx:TextInput id="searchInput"/>
</mx:FormItem>
<mx:FormItem label="in:">
<mx:ComboBox id="searchCombo" dataProvider="[HONAME,ADDRESS,CITY,STATE,PHONE,ACCOUNT]">
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Search" id="srchButton" click="createObj()"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
<mx:DataGrid x="176.5" y="239" dataProvider="searchResults">
</mx:DataGrid>
</mx:Application>