<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Expanding nodes in a Flex Tree control using the openItems property</title>
	<atom:link href="http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Mon, 13 Feb 2012 01:38:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Kaptein</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-8284</link>
		<dc:creator>Peter Kaptein</dc:creator>
		<pubDate>Sun, 29 Aug 2010 16:52:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-8284</guid>
		<description>Hi Peter, 

Great article.
For a Project with BlazeDS I had to work with updating and reloading Tree View Data without breaking the User Experience (all nodes closed when data reloaded).
Instead of keeping tabs on &quot;which node was opened before?&quot; and &quot;what was the scroll-position?&quot; I found a way to inject the new state of the Tree View data into the existing data provider.
  
See article here if you are interested.
BlazeDS and Smooth Data Injection – Reloading the Tree View Data Provider without breaking the User Experience - http://bit.ly/92h7on
  
Hope this is of help as well.
  
Peter</description>
		<content:encoded><![CDATA[<p>Hi Peter, </p>
<p>Great article.<br />
For a Project with BlazeDS I had to work with updating and reloading Tree View Data without breaking the User Experience (all nodes closed when data reloaded).<br />
Instead of keeping tabs on &#8220;which node was opened before?&#8221; and &#8220;what was the scroll-position?&#8221; I found a way to inject the new state of the Tree View data into the existing data provider.</p>
<p>See article here if you are interested.<br />
BlazeDS and Smooth Data Injection – Reloading the Tree View Data Provider without breaking the User Experience &#8211; <a href="http://bit.ly/92h7on" rel="nofollow">http://bit.ly/92h7on</a></p>
<p>Hope this is of help as well.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lakjohn</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-7684</link>
		<dc:creator>lakjohn</dc:creator>
		<pubDate>Tue, 11 May 2010 12:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-7684</guid>
		<description>this is how i am creting the trees

			
			
				
			 
	</description>
		<content:encoded><![CDATA[<p>this is how i am creting the trees</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lakjohn</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-7683</link>
		<dc:creator>lakjohn</dc:creator>
		<pubDate>Tue, 11 May 2010 12:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-7683</guid>
		<description>Hi,
  I am new to flex and am facing the a problem with flex tree ,it is not displaying all the node when an ever fires .. here is my scenario

we have two flex tree..one is Left side tree and other is right side treee .I call the left tree as ltree and right tree as rtree. I am using the object as the data provider for both the trees. ltree has the lot of nodes and each node&#039;s data has an Object with its properties. If we click on any node of the ltree,i have to display the rtee with all the properties of the ltree node. So i am getting the object from ltree and creating the root node of rtree and assiging it as the dataprovider to rtree . rtree data provider need to change faster as soon as evvent fires on ltree node.I just assigned the rtree&#039;s data provider and rtree is displaying the contents,but the problem is rtree nodes/childs are not displaying properly .when expand any node of the rtree only few child nodes display once and few display secondtime. so the display is not consistent.i am doing all the things after updating the dataprovider like invalidateDisplayList,validateNow on rtree as well as the panel that contains rtree.but no luck..here is my bit of sample code
&lt;pre lang=&quot;actionscript3&quot;&gt;
package actionscript.shmtool.tree
{
	import mx.collections.ArrayCollection;
	[Bindable]
	public class TreeNode
	{
		public function TreeNode()
		{
		}
		public var type:String=&quot;&quot;;
		
		public var name:String=&quot;&quot;;
		public var isLeaf:Boolean;
		public var children:ArrayCollection;
		public var parentNode:DataTreeNode;
		public var dataObject:Object;
		public function addChild(child:DataTreeNode):void{
			if (this.children == null)  
					 this.children = new ArrayCollection(); 

			children.addItem(child);	
		}
	}
}
&lt;/pre&gt;





 


and on the selection of ltree node,i am doing the below
&lt;pre lang=&quot;actionscript3&quot;&gt;
var configRootNode:DataTreeNode= commonUtils.getConfigTreeNode(selectedNode);
configurationTree.invalidateList();
configurationTree.dataProvider=configRootNode;
configurationTree.validateNow();
configurationTree.invalidateList();
configurationTree.invalidateDisplayList();
configTreePanel.visible=true;						
&lt;/pre&gt;

   I am reading lot of blogs that i need to set the binding to the label field,but i am not aware where and how i have to set incase if i am using objects as the data probider. Could you please assist me the solution to my problem

Thanks
lakjohn</description>
		<content:encoded><![CDATA[<p>Hi,<br />
  I am new to flex and am facing the a problem with flex tree ,it is not displaying all the node when an ever fires .. here is my scenario</p>
<p>we have two flex tree..one is Left side tree and other is right side treee .I call the left tree as ltree and right tree as rtree. I am using the object as the data provider for both the trees. ltree has the lot of nodes and each node&#8217;s data has an Object with its properties. If we click on any node of the ltree,i have to display the rtee with all the properties of the ltree node. So i am getting the object from ltree and creating the root node of rtree and assiging it as the dataprovider to rtree . rtree data provider need to change faster as soon as evvent fires on ltree node.I just assigned the rtree&#8217;s data provider and rtree is displaying the contents,but the problem is rtree nodes/childs are not displaying properly .when expand any node of the rtree only few child nodes display once and few display secondtime. so the display is not consistent.i am doing all the things after updating the dataprovider like invalidateDisplayList,validateNow on rtree as well as the panel that contains rtree.but no luck..here is my bit of sample code</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> actionscript<span style="color: #000066; font-weight: bold;">.</span>shmtool<span style="color: #000066; font-weight: bold;">.</span>tree
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>collections<span style="color: #000066; font-weight: bold;">.</span>ArrayCollection<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> TreeNode
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TreeNode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">type</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isLeaf<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">children</span><span style="color: #000066; font-weight: bold;">:</span>ArrayCollection<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">parentNode</span><span style="color: #000066; font-weight: bold;">:</span>DataTreeNode<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> dataObject<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000066; font-weight: bold;">:</span>DataTreeNode<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">children</span> == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>  
					 <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">children</span> = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> 
&nbsp;
			<span style="color: #004993;">children</span><span style="color: #000066; font-weight: bold;">.</span>addItem<span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>	
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>and on the selection of ltree node,i am doing the below</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> configRootNode<span style="color: #000066; font-weight: bold;">:</span>DataTreeNode= commonUtils<span style="color: #000066; font-weight: bold;">.</span>getConfigTreeNode<span style="color: #000000;">&#40;</span>selectedNode<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
configurationTree<span style="color: #000066; font-weight: bold;">.</span>invalidateList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
configurationTree<span style="color: #000066; font-weight: bold;">.</span>dataProvider=configRootNode<span style="color: #000066; font-weight: bold;">;</span>
configurationTree<span style="color: #000066; font-weight: bold;">.</span>validateNow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
configurationTree<span style="color: #000066; font-weight: bold;">.</span>invalidateList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
configurationTree<span style="color: #000066; font-weight: bold;">.</span>invalidateDisplayList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
configTreePanel<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">visible</span>=<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>   I am reading lot of blogs that i need to set the binding to the label field,but i am not aware where and how i have to set incase if i am using objects as the data probider. Could you please assist me the solution to my problem</p>
<p>Thanks<br />
lakjohn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arley</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-7494</link>
		<dc:creator>Arley</dc:creator>
		<pubDate>Tue, 13 Apr 2010 16:15:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-7494</guid>
		<description>Jason, as soon as I posted, I read your response and tried it in the change event of my dataGrid. It worked like a charm and it&#039;s way more efficient. Thanks!</description>
		<content:encoded><![CDATA[<p>Jason, as soon as I posted, I read your response and tried it in the change event of my dataGrid. It worked like a charm and it&#8217;s way more efficient. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arley</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-7493</link>
		<dc:creator>Arley</dc:creator>
		<pubDate>Tue, 13 Apr 2010 16:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-7493</guid>
		<description>Thanks for the example. I have a case that I haven&#039;t really found a good solution to so I came up with a bit of a hack.

I would include the source, but I keep getting a spam error. Sorry.

I needed an event to fire when the dataGrid.selectedItem changed. I tried a change event on the grid, but the expandChildren method didn&#039;t seem to take. The added Event seemed to be the only way I could update the data at the right time to get the tree to expand.

If you think of anything to clean up this mess of a code I&#039;d love to hear about it!</description>
		<content:encoded><![CDATA[<p>Thanks for the example. I have a case that I haven&#8217;t really found a good solution to so I came up with a bit of a hack.</p>
<p>I would include the source, but I keep getting a spam error. Sorry.</p>
<p>I needed an event to fire when the dataGrid.selectedItem changed. I tried a change event on the grid, but the expandChildren method didn&#8217;t seem to take. The added Event seemed to be the only way I could update the data at the right time to get the tree to expand.</p>
<p>If you think of anything to clean up this mess of a code I&#8217;d love to hear about it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Swick</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-2297</link>
		<dc:creator>Jason Swick</dc:creator>
		<pubDate>Fri, 03 Apr 2009 19:10:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-2297</guid>
		<description>I have a tree that the dataprovider changes, and using methods such as &lt;code&gt;tree.openItems = tree.dataProvider;&lt;/code&gt; would open only the top level, and &lt;code&gt;tree.dataProvider().descendants();&lt;/code&gt; would open everything EXCEPT the top level. what I finally came up with is &lt;code&gt;tree.openItems = tree.dataProvider[0].parent().descendants();&lt;/code&gt; and that opens everything.</description>
		<content:encoded><![CDATA[<p>I have a tree that the dataprovider changes, and using methods such as <code>tree.openItems = tree.dataProvider;</code> would open only the top level, and <code>tree.dataProvider().descendants();</code> would open everything EXCEPT the top level. what I finally came up with is <code>tree.openItems = tree.dataProvider[0].parent().descendants();</code> and that opens everything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdh</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-2299</link>
		<dc:creator>mdh</dc:creator>
		<pubDate>Mon, 15 Dec 2008 22:37:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-2299</guid>
		<description>Thanks for this post! It helped me solve an issue I didn&#039;t think I was ever going to figure out.</description>
		<content:encoded><![CDATA[<p>Thanks for this post! It helped me solve an issue I didn&#8217;t think I was ever going to figure out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ILIUS</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-2300</link>
		<dc:creator>ILIUS</dc:creator>
		<pubDate>Sun, 07 Dec 2008 16:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-2300</guid>
		<description>How can i close all nodes except one i&#039;ve just opened? Kind of accordion.</description>
		<content:encoded><![CDATA[<p>How can i close all nodes except one i&#8217;ve just opened? Kind of accordion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ILIUS</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-2298</link>
		<dc:creator>ILIUS</dc:creator>
		<pubDate>Tue, 18 Nov 2008 05:14:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-2298</guid>
		<description>&lt;pre lang=&quot;actionscript3&quot;&gt;
private function openAllNodes():void {
    tree.openItems=dp.descendants(&quot;*&quot;)
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> openAllNodes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
    tree<span style="color: #000066; font-weight: bold;">.</span>openItems=dp<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">descendants</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;*&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Pohlmann</title>
		<link>http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/comment-page-1/#comment-2296</link>
		<dc:creator>Peter Pohlmann</dc:creator>
		<pubDate>Tue, 15 Apr 2008 14:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/15/expanding-nodes-in-a-flex-tree-control-using-the-openitems-property/#comment-2296</guid>
		<description>hello all,



first of all a big respect for this blog.


Got also problems with the vertical scrolling....


Here is nice tutorial for a tree with amfPHP (http://www.sephiroth.it/tutorials/fl...fphp/index.php)

i&#039;ve used it for my app, but running into some trouble now, with the scrollbars, what i really didn&#039;t expect!!

here you can see the app and the source code:
http://www.rootop.de/testing/TestTree.html

it&#039;s all german, so when you click on Enomis -&gt; Einzelstoffe-&gt;Obst , then there appears a scrollbar for a short time and then disappears again, even if there are more branches... it really makes me mad.. i tried serveral function like..

//scroll always to bottom, otherwise, only the items are shown, that are in the visible area
tree.verticalScrollPosition=tree.maxVerticalScroll Position;

tree.invalidateList();

tree.validateNow();

but nothing really works. the general problem is, that i don&#039;t know when flex display the scrollbar and when not. because in some cases it works.
so, if there is a solution or a workaround, i would be very happy. thanks in advance. kind regards, peter</description>
		<content:encoded><![CDATA[<p>hello all,</p>
<p>first of all a big respect for this blog.</p>
<p>Got also problems with the vertical scrolling&#8230;.</p>
<p>Here is nice tutorial for a tree with amfPHP (<a href="http://www.sephiroth.it/tutorials/fl...fphp/index.php" rel="nofollow">http://www.sephiroth.it/tutorials/fl&#8230;fphp/index.php</a>)</p>
<p>i&#8217;ve used it for my app, but running into some trouble now, with the scrollbars, what i really didn&#8217;t expect!!</p>
<p>here you can see the app and the source code:<br />
<a href="http://www.rootop.de/testing/TestTree.html" rel="nofollow">http://www.rootop.de/testing/TestTree.html</a></p>
<p>it&#8217;s all german, so when you click on Enomis -&gt; Einzelstoffe-&gt;Obst , then there appears a scrollbar for a short time and then disappears again, even if there are more branches&#8230; it really makes me mad.. i tried serveral function like..</p>
<p>//scroll always to bottom, otherwise, only the items are shown, that are in the visible area<br />
tree.verticalScrollPosition=tree.maxVerticalScroll Position;</p>
<p>tree.invalidateList();</p>
<p>tree.validateNow();</p>
<p>but nothing really works. the general problem is, that i don&#8217;t know when flex display the scrollbar and when not. because in some cases it works.<br />
so, if there is a solution or a workaround, i would be very happy. thanks in advance. kind regards, peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>

