Hi,
That helps a bit, in my tree I am seeing the actual xml when I run my
application in flex. I have CFC function returning a string, I tried
having return xml and same thing.
*******************
After I make my remote object call in my result handler I have this:
public function result( data:Object ):void {
var event:ResultEvent = data as ResultEvent
model.treeData = event.result as XML;
}
It seems I have to cast it as XML otherwise in my "model" I get a 'type'
error
**************
In my model which is a [Bindable] class I have:
public var treeData:XML;
******************
And in the view I have
<mx:Tree id="acTree"
width="50%"
height="100%"
showRoot="false"
dataProvider="{model.treeData}"
change="treeChanged(event)"
/>
Any help appreciated as I am getting the actual xml in the tree. How do
you get the label to work also?
--- In [email protected], "jensen.axel" <[EMAIL PROTECTED]> wrote:
>
> Hi Malik,
>
> I have never exactly populated a tree with straight query data, i
> usually convert it to xml first within the cfc that i'm calling, and i
> return a string from that cfc... it took some playing with but i
> eventually got it...
>
> google the following:
>
> "using cfxml returning it to flex?" or something along those lines...
> that will teach you how to convert your query to xml... but the thing
> is, flex doesn't want the actual xml doc from coldfusion, it wants the
> valid string format...
>
> here is my example
>
>
http://axel.cfwebtools.com/index.cfm/2007/2/6/Returning-a-query-to-flex-\
as-xml#more
>
> once you get it into flex, it will be declared as xml, and then in
> your mx:Tree your going to declare a showRoot="false"
>
> the blog might be a little hard to follow, but I hope it helps.
>
> --- In [email protected], "malik_robinson"
> Malik_Robinson@ wrote:
> >
> >
> > Hi,
> >
> > I want to display a list of companies and contacts associated with
each
> > company in my app. I think a tree can do this, but I wanted to ask
how
> > can I populate a tree from a query? I would like the folders to be
the
> > companies and when you expand the folder you see a list of contacts
> > associated.
> >
> > I am using CF so in CF I have a query that does a group by so I'd
like
> > to use that and populate the tree but I am unsure on how to do this.
I
> > understand the tree needs a data provider, but how do I handle the
> > grouping?
> >
> > Thanks
> >
> > -M
> >
>