Hi Tracy,
Thanx for that, i followed that and now i am getting
long xml in ( which is same in both column ) inside my datagrid. I was
getting same result when result format was text previously. My problem is
how to break up that xml data, map it to respective coloums and show it
row by row. Earlier i was thinking of using XML decoder, and ther write a
function to chop n display those objects , but thought there must be a
simpler and smarter way to do that automatically.
On Jan 10, 2008 11:10 AM, Tracy Spratt <[EMAIL PROTECTED]> wrote:
> You do not have XML in your result and dataProvider, you have a nested
> object structure which is the default. Set resultFormat="e4x", then
> cast/convert event.result to XML, then view it using toXMLString(). Then
> go from there.
>
>
>
> Tracy
>
>
> ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *YOGESH JADHAV
> *Sent:* Wednesday, January 09, 2008 8:15 AM
> *To:* [EMAIL PROTECTED]; [email protected]
> *Subject:* [flexcoders] displaying XML in datagrid
>
>
>
> Hi all,
> I trying out the tutorial at
> http://devzone.zend.com/article/11-Integrating-Adobe-Flex-and-PHP
> It is working half way but, i.e. values are submitted properly to
> database. But Manipulating data is creating problem.
> Here is the original code for displaying data.
>
> *<mx:DataGrid id="dgUserRequest" x="22" y="128" dataProvider="{*
>
> *userRequest.result.users.user}">
>
> <mx:columns>
>
> <mx:DataGridColumn headerText="User ID" columnName="userid"/>
>
> <mx:DataGridColumn headerText="User Name" columnName="username"/>*
>
> *
>
> </mx:columns>
>
> </mx:DataGrid>
>
> <mx:TextInput x="22" y="292" id="selectedemailaddress"
> text="{dgUserRequest.selectedItem.emailaddress}"/>
>
> </mx:Application>*
>
> But it was giving error for columnName, as i changed it id, i started
> complaining as another textinput was having same name as userName, i changed
> it userName1 and added result and fault properties to my HTTPService
>
> *<mx:HTTPService id="userRequest" url="http://nikhil/request.php"
> useProxy="false"
> result="handlePlain(event);"
> fault="handleFault(event);"
> resultFormat="text"
> method="POST">
>
>
> private function handlePlain(event:ResultEvent):void
> {
> dgUserRequest.dataProvider = event.result;
> //userid.dataField = event.result.users.userid;
> //username1.dataField = event.result.users.username;
> }
>
> private function handleFault(event:FaultEvent):void
> {
> Alert.show(event.fault.toString(),"Error");
> }
>
>
> *Now it gives me error that it cant find 'users' in string , i tried by
> changing the result format from text to xml and e4x, but it is of no use.
> assigning each field to each column doesn't make sense.
>
> Any kinda help will be appreciated.
>
> Regards,
> Yogesh
>
>
--
Regards,
Yogesh