The dataProvider can be contained in an object, but the dataProvider
assignment should be an array (for list based controls).
Attached is an example that takes two xml source files, builds a
dataProvider using one column (yesterday) from one file and the rest
from the other, and adds a column that shows a calculated value.
Tracy
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Joel Parish
Sent: Thursday, May 26, 2005 12:54 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Binding a webservice result to a dataprovider
If I change the dataProvider to a list and map the dataProvider to
ws.doStockHistory.result.date or ws.doStockHistory.result.price the
list will show the right data, how do i combine these two into a
datagrid? Can a datagrid use an object as a dataProvider or must it be
an array?
--- In flexcoders@yahoogroups.com, Abdul Qabiz [EMAIL PROTECTED] wrote:
Hi,
Your code looks fine. I guess, something is wrong with Webservice
itself, it throws error.
I have used a different webservice and it works fine, see the
following
code:
##GetQuotesWS.mxml##
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml;
mx:WebService concurrency=single id=ws
result=alert('result recieved')
wsdl=http://www.xignite.com/xquotes.asmx?WSDL;
mx:operation name=GetQuotes
mx:request
SymbolMACR,ADBE,YHOO,MSFT/Symbol
/mx:request
/mx:operation
/mx:WebService
mx:Panel width=100% height=100%
mx:VBox width=100% height=100%
mx:DataGrid id=grid width=100%
height=100% dataProvider={ws.GetQuotes.result}
mx:columns
mx:Array
mx:DataGridColumn columnName=Symbol
headerText=Symbol/
mx:DataGridColumn columnName=Name
headerText=Name/
mx:DataGridColumn columnName=Date
headerText=Date/
mx:DataGridColumn columnName=Open
headerText=Open/
mx:DataGridColumn columnName=High
headerText=High/
mx:DataGridColumn columnName=Low
headerText=Low/
mx:DataGridColumn columnName=Change
headerText=Change/
mx:DataGridColumn columnName=Last
headerText=Last/
/mx:Array
/mx:columns
/mx:DataGrid
mx:Button label=Get
click=ws.GetQuotes.send(); /
/mx:VBox
/mx:Panel
/mx:Application
Hope that helps..
-abdul
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
Behalf Of cmdpromptjunkie
Sent: Thursday, May 26, 2005 8:41 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Binding a webservice result to a dataprovider
Hello,
I am relatively new to the flex community. I have a question regarding
a small application that I'm developing to learn flex. I've tried a
lot of things but no mater what I do I cannot seem to bind the result
of this webservice call to a dataProvider (ideally a chart) :(
Heres the code for my app.
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml;
mx:WebService concurrency=single id=ws
result=alert('recieved')
wsdl=http://www.flash-db.com/services/ws/stockHistory.wsdl;
mx:operation name=doStockHistory
mx:request
usernameany/username
passwordany/password
symbolNDAQ/symbol
intervaldaily/interval
dayFrom1/dayFrom
monthFrom1/monthFrom
yearFrom2005/yearFrom
/mx:request
/mx:operation
/mx:WebService
mx:Panel width=100% height=100%
mx:VBox width=100% height=100%
mx:DataGrid id=grid width=100%
height=100%
dataProvider={ws.doStockHistory.result}
mx:columns
mx:Array
mx:DataGridColumn
columnName=date /
mx:DataGridColumn
columnName=close /
/mx:Array
/mx:columns
/mx:DataGrid
mx:Button label=Get
click=ws.doStockHistory.send(); /
/mx:VBox
/mx:Panel
/mx:Application
Yahoo! Groups Links
Yahoo! Groups Links
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
* To unsubscribe