RE: [flexcoders] Populating a Combobox from an HTTPService

2005-02-25 Thread Tracy Spratt
You may not be at the right level of your result object.

To debug, create a handler function and call it from the result event of
the HTTPService:
mx:HTTPService result=onResult(event)

Private function onResult(oEvent:Object):Void{
trace(oEvent.result.list.customer.length) //or alert
}
You should see the number of items returned. If you do not, you don't
have the data structure you think. The datagrid needs an array, where
the elements are the rows, and contain an object with properties(in your
case) label and data.

Try: oEvent.result.list.length
Enable debuggin of the http service proxy in the flex-config file,
observe what is being returned.

Or use the netConnectionDebugger or FlexBuilder network monitor to see
what your data structure is.

Tracy



-Original Message-
From: digital_eyezed [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 24, 2005 6:24 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Populating a Combobox from an HTTPService



Hi,

I have an HTTP service with a returned dataprovider. I want to 
populate a combobox with this dataprovider. The tags within the 
returned xml in the dataprovider are label and data.

I tried this:

mx:HTTPService id=cust url=cus.jsp/

mx:VBox
mx:ComboBox id=cusBox 
dataProvider={cust.result.list.customer}/mx:ComboBox
/mx:VBox

The box drops down, but it has no data!

Thanks in advance.

Iain





 
Yahoo! Groups Links



 









Re: [flexcoders] Populating a Combobox from an HTTPService

2005-02-25 Thread Jeff Steiner
If you are seeing the combobox look like it contains the data (meaning that
you have a solid drop down) but there is nothing there, you probably
overlooked labelField=. Add that as a property and put the name of the
element that you want to see there.

Jeff
http://www.flexauthority.com

- Original Message - 
From: digital_eyezed [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, February 24, 2005 3:23 PM
Subject: [flexcoders] Populating a Combobox from an HTTPService




 Hi,

 I have an HTTP service with a returned dataprovider. I want to
 populate a combobox with this dataprovider. The tags within the
 returned xml in the dataprovider are label and data.

 I tried this:

 mx:HTTPService id=cust url=cus.jsp/

 mx:VBox
 mx:ComboBox id=cusBox
 dataProvider={cust.result.list.customer}/mx:ComboBox
 /mx:VBox

 The box drops down, but it has no data!

 Thanks in advance.

 Iain






 Yahoo! Groups Links