Hi Robert,

Here is a test app which demonstrates the problem:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; width="200"
height="300" layout="absolute" creationComplete="createTopNodes();">
<mx:Script>
<![CDATA[
import mx.events.TreeEvent;
import mx.collections.ArrayCollection;

[Bindable] private var treeNodes:ArrayCollection = new
ArrayCollection();

private function createTopNodes():void
{
var newTestObj:TestObj;
for (var i:int=1; i<=20; i++)
{
newTestObj = new TestObj();
newTestObj.id = i.toString();
newTestObj.children = new Array();
treeNodes.addItem(newTestObj);
}
}

private function itemOpenHandler(e:TreeEvent):void
{
var selectedObj:TestObj = TestObj(e.item);
if (selectedObj.hasChildren)
{
return;
}
var newTestObj:TestObj;
for (var i:int=1; i<=20; i++)
{
newTestObj = new TestObj();
newTestObj.id = selectedObj.id + "_" + i.toString();
newTestObj.children = new Array();
selectedObj.children.push(newTestObj);
}
selectedObj.hasChildren = true;
}
]]>
</mx:Script>
<mx:Tree id="testTree" width="100%" height="100%"
dataProvider="{treeNodes}" labelField="id" itemOpen="itemOpenHandler
(event);"/>
</mx:Application>


TestObj is defined as:

public class TestObj
{
public var id:String;
public var hasChildren:Boolean = false;
public var children:Array;
}

Thanks for your help.

I've submitted this as a bug on Adobe's site because as Stephane 
pointed out, the tree examples on Adobe's own Quick Start pages 
(http://www.adobe.com/devnet/flex/quickstart/working_with_tree/) also 
exhibit the problem.  Try this on the first example application on 
that page:

1.  Expand Operations (there are no scroll bars as the tree area 
hasn't been filled yet);
2.  Add new Operations employees until a scroll bar should appear.  
It doesn't.

Or:

1. Before expanding any nodes, add 3 Operations employees;
2. Expand all top level nodes so that the scroll bar appears;
3. Scroll to the top of the visible tree;
4. Add another 3 (or more) Operations employees.  Note that once the 
new nodes get to the bottom of the visible area, the scroll bar does 
not update (shrink) as it should.  If you scroll down you will see 
that the new nodes have overwritten those in the Engineering section.

In either case if you collapse and then expand the top-level nodes 
the problem sorts itself out.

Regards,

Nick.

--- In [email protected], "Robert Chyko" <[EMAIL PROTECTED]> wrote:
>
> I've kinda lost track of this thread, but do you have a code 
example?
> Something stripped down perhaps?  If so I could possibly take a 
look at
> it (I'm getting my butt kicked at work currently) but I just went
> through something similar here not too long ago.
>  



Reply via email to