So why not take that array collection that worked and assign to the DataGrid?  That’s what DataGrid expects now.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of yaagcur
Sent: Wednesday, November 02, 2005 8:06 AM
To: [email protected]
Subject: [flexcoders] problem adapting to FLEX 2 on defining variables

 

I had  the following working OK in FLEX 1.5

<mx:Script>
      <![CDATA[
var gridResult:Object

function getPlayersResultHandler(result):Void {

gridResult=result;
// other stuff
}

]]>
</mx:Script>

<mx:DataGrid dataProvider="{gridResult}">

However I am finding it impossible to duplicate in FLEX2/AS3

I have tried various alternatives e.g
[BINDABLE]
public var myTest:Object - which gives me a "no type declaration" error

Placing the variable within the resulthandler gives an "access of
undefined property" error (predictably I suppose) in the <mx:DataGrid>

The data is coming across OK because if I alternatively do
<mx:ArrayCollection id="gridResult"
source="{mx.utils.ArrayUtil.toArray(ContactService.getPlayers.result)}"
/>
I can populate fine
And also putting breakpoints in the resulthandler I get debug results
e.g
result=[](0x6c5c746)
[0] Object
FULLNAME="Joe Blow"






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex


YAHOO! GROUPS LINKS




Reply via email to