[flexcoders] mysql amfphp array parsing

2006-07-30 Thread Impudent1
ok I seem to be having a total mindlock on this...

I have amfphp running some functions to connect to a mysql database. I 
have the login logic all working and was starting to link the interface 
up. Firstly being a combobox populate.

So with my function returning an array of: 0- id  2
   teamname blah
   teamlead bla
   teamstatus active
   0- id  13
   teamname sda
   teamlead dsadfs
   teamstatus active

I have setup the functions in my app for it as:

[Bindable]
public var teams:ArrayCollection;

public function getTeamlist() : void{
gateway = new RemotingConnection(gatewayURL);
gateway.call(MySQL_Login.team_pulldown, new 
Responder(onResultGetTeamlist, onFault));
}

public function onResultGetTeamlist( result:Array ) : void{
teams = new ArrayCollection( result );
}

public function onFault ( fault:String ) : void{
trace( fault );
}

then set my new states canvas to :
mx:Canvas label=Users width=100% height=100% 
initialize=getTeamlist()


now, if I hardcode the combobox to be:

mx:ComboBox x=91 y=70 id=userTeamDropdown 
dataProvider={teams.getItemAt(2).teamname}/mx:ComboBox

it will load up the page on proper login and populate the combo box with 
the single teamname.

This is where I am getting stuck. Is there a simple way for me to just 
get the arraycollection to just pull the teamnames from the amfphp 
result and populate the combo box??

I know I am missing something both simple and obvious here so tia for 
any ideas :)

Impudent1
LeapFrog Productions



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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] mysql amfphp array parsing

2006-07-30 Thread JesterXL
Maybe labelName for the ComboBox set to teamname?

- Original Message - 
From: Impudent1 [EMAIL PROTECTED]
To: flexcoders flexcoders@yahoogroups.com
Sent: Sunday, July 30, 2006 11:36 PM
Subject: [flexcoders] mysql amfphp array parsing


ok I seem to be having a total mindlock on this...

I have amfphp running some functions to connect to a mysql database. I 
have the login logic all working and was starting to link the interface 
up. Firstly being a combobox populate.

So with my function returning an array of: 0- id  2
   teamname blah
   teamlead bla
   teamstatus active
   0- id  13
   teamname sda
   teamlead dsadfs
   teamstatus active

I have setup the functions in my app for it as:

[Bindable]
public var teams:ArrayCollection;

public function getTeamlist() : void{
gateway = new RemotingConnection(gatewayURL);
gateway.call(MySQL_Login.team_pulldown, new 
Responder(onResultGetTeamlist, onFault));
}

public function onResultGetTeamlist( result:Array ) : void{
teams = new ArrayCollection( result );
}

public function onFault ( fault:String ) : void{
trace( fault );
}

then set my new states canvas to :
mx:Canvas label=Users width=100% height=100% 
initialize=getTeamlist()


now, if I hardcode the combobox to be:

mx:ComboBox x=91 y=70 id=userTeamDropdown 
dataProvider={teams.getItemAt(2).teamname}/mx:ComboBox

it will load up the page on proper login and populate the combo box with 
the single teamname.

This is where I am getting stuck. Is there a simple way for me to just 
get the arraycollection to just pull the teamnames from the amfphp 
result and populate the combo box??

I know I am missing something both simple and obvious here so tia for 
any ideas :)

Impudent1
LeapFrog Productions



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



 



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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] mysql amfphp array parsing

2006-07-30 Thread Impudent1
JesterXL wrote:
 Maybe labelName for the ComboBox set to teamname?


You , are a heck of a person :P

I didn't think to look at it as setting the dataprovider then setting 
the labelfield but yes setting up as:

dataProvider={teams} labelField=teamname

was the trick. ty ty

Impudent1
LeapFrog Productions





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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/