problem with webservice and datagrid


i'm trying populate datagrid result set cf webservice , works fine except when add datagridcolumns. appears populate grid, rows blank.

its basic webservice call returns resultset query lookup , if don't add datagridcolumns works fine, add datafridcolums appears populate grid, rows blank.

here mxml works: uncomment datagridcolumns , doesn't display data.

<?xml version="1.0"?>
<!-- simple example demonstrate webservice tag. -->
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml">

<mx:webservice id="ws" wsdl=" http://localhost/mydata.cfc?wsdl"
useproxy="false">
<mx:operation name="getmydata">
<mx:request>
<userid>{userid.text}</userid>
</mx:request>
</mx:operation>
</mx:webservice>


<mx:panel title="webservice example" height="75%" width="75%"
paddingtop="10" paddingbottom="10" paddingleft="10" paddingright="10">

<mx:label width="100%" color="blue"
text="enter user id."/>

<mx:textinput id="userid" text=""/>
<mx:button label="get items" click="ws.getmydata.send()"/>

<mx:datagrid id="dg" width="100%" dataprovider="{ws.getmydata.lastresult}">
<!-- <mx:columns>
<mx:datagridcolumn datafield="col1" headertext="col 1"/>
<mx:datagridcolumn datafield="col2" headertext="col 2"/>
<mx:datagridcolumn datafield="col3" headertext="col 3"/>
<mx:datagridcolumn datafield="col4" headertext="col 4"/>
</mx:columns> -->
</mx:datagrid>

</mx:panel>
</mx:application>

webservice:

<cfcomponent>

<cffunction access="remote" name="getmydata" output="no" returntype="query">

<cfargument name="userid" type="string" required="yes">

<cfquery name="thisquery" datasource="somedsn">
select
col1, col2, col3, col4

sometable

userid = '#userid#'
</cfquery>

<cfreturn thisquery>

</cffunction>

</cfcomponent>

all examples i've looked @ use column name bind grid column... missing? thanks.

datafield="the_name_of_the_item_in_the_collection_you_wish_to_display"


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

FLV Playlist

xml playlist