Hey Guys,
my problem was, that the tree was reacting weird when scrolling
around after adding data to its dataprovider (XMLListCollection)
using setChildren. (When the user clicks a branch node, it's childnodes
should be loaded from my streamingserver (=returns XML))
I found out, that the problem was, that the tree wasn't "prepared"
for the "arrival" of new childnodes..
The nodes (branchNodes) where I wanted to add children later gave
me the return valueof false on asking hasChildren()
And there lies the problem: The tree doesn't expect new children
and reacts a little bit weird (which maybe belongs to the uncorrect use
of measure, as you said, Mike).
Anyway, I solved my problem like this:
When first generating my DataProvider I added on each empty branch
node a single node with just the label "loading...", what makes the
datadescriptor return true on hasChildren.
When the subenodes are loaded, I just delete the "loading..." node,
as you can see on these screenshots:
http://marcelfahle.com/labs/flex2/screens/cptreeproblem1.jpg
http://marcelfahle.com/labs/flex2/screens/cptreeproblem2.jpg
http://marcelfahle.com/labs/flex2/screens/cptreeproblem3.jpg
Using this "hack" everything works good for me..
If anybody wants to see it in action, just drop me a line off-list..
Michael Schmalle wrote:
Hi,
There is some issues with the Tree and XML dtat provider collections.
One thing I can suggest is;
Add an event listener to the divider bar release, I can't remeber what
it is, in that handler call
myTree.invalidateList();
Give it a try and let me know.
I have the same issues with using itemRenderers and changing some
internal data specific things. After I am done with my process, I
called invalidateList() and it did a nice redraw quickly.
There probably is just an update isse and measure() is not being called
correctly.
Peace, Mike
On 8/23/06, e baggg <
[EMAIL PROTECTED]com> wrote:
I too have had problems with XML nodes in tree. One thing that
eliminated a lot of the issues was reassigning the dataProvider of the
tree explictly (right after you update the node.
so...
[Bindable]
private var xmlN : XML ....
private function updateTreeDataProvider : void {
//code that updates xmlN
treeNav.dataProvider= xmlN;
}
<mx:Tree id="treeNav"
Marcel Fahle <[EMAIL PROTECTED]com>
wrote:
Hi Dave,
did you found a solution on that?
I've got a similar problem here.
Marcel
Dave Bobby wrote:
This is flaky, might be a bug.
root
-a
--aa
--ab
--ac
-b
-c
--ca
--cb
--cc
say the last server retrieval got ca, cb and cc. but the tree did not
show a scrollbar. this tree is in a vDivided box, so when i move the
divider upto b, i see a scrollbar, but when i move divider to cb or
cc, ca-cb and cc disappear and no scrollbar.
bug? or am i doing something wrong? i think that the tree should be
refreshing when i do such operations.
thanks.
--- In
[EMAIL PROTECTED]ups.com, "Dave Bobby"
<[EMAIL PROTECTED]>
wrote:
>
> I am trying to append data retrieved to selectedItems in the tree
> represented by an XMLListCollection. During the trace I see that
the
> retrieived items have been added to the XMLListCollection
correctly
> and this collection in Bindable.
>
> But the tree itself behaves wierd. Sometimes it shows the
scrollbars,
> sometimes not. Sometimes, when I scroll up and down, it collates
> different nodes to different parents visually.
>
> Any ideas?
>
> Thanks.
>
> Dave.
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
What goes up, does come down.