HTTPService data into a tree

26 views
Skip to first unread message

Fahad javed

unread,
Mar 4, 2008, 2:03:11 AM3/4/08
to flex_...@googlegroups.com
I have an HTTPService which provides a data I want to show in a tree.

I have worked out the example of having an XMLList into a tree.

The source JSP is generting the following data:

<?xml version="1.0" encoding="utf-8"?>

<node label="Mail Box">
<node label="Inbox">
<node label="Marketing"/>
<node label="Product Management"/>
<node label="Personal"/>
</node>
            <node label="Outbox">
<node label="Professional"/>
<node label="Personal"/>
</node>
<node label="Spam"/>
<node label="Sent"/>
</node>
The code for defining HTTPService is
 <mx:HTTPService id="srv2" url="receipientList.jsp">
 </mx:HTTPService>

The code for tree is

     <mx:Tree id="dateSelectionTree"  
         x="200" y="300" labelField="@label"
                showRoot="false" dataProvider="{srv2.lastResult}"  width="100%" height="100%" />

The result however prints out [object Object] in the tree.

What am I doing wrong?

Thanks for your time

Fahad

Kalpataru Roy

unread,
Mar 4, 2008, 4:28:21 AM3/4/08
to flex_...@googlegroups.com
Please try :

    <mx:HTTPService id="lsrv2"
        url="receipientList.jsp"
        method="POST" useProxy="false"
        resultFormat="e4x"
        />

{srv2.lastResult} ==> ok you can also try for {srv2.result}
--
Kalpataru Roy
Mobile :+919850021354

kumar

unread,
Mar 4, 2008, 5:35:02 AM3/4/08
to Flex India Community
the dataProvider property value in the Tree control is wrongly
specified as per your XML page , the value is
dataProvider="{srv2.lastResult.node.node}" labelField="label" and
remaining are all same, it will work now.

regards,
kumar.
Reply all
Reply to author
Forward
0 new messages