<?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: Maintaining state on Tree Component while updating remote data</title>
	<atom:link href="http://blog.enestrom.com/20090312/maintaining-state-on-tree-component-while-updating-remote-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.enestrom.com/20090312/maintaining-state-on-tree-component-while-updating-remote-data/</link>
	<description>Ramblings of a web developer</description>
	<lastBuildDate>Mon, 26 Jul 2010 10:33:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Eneström</title>
		<link>http://blog.enestrom.com/20090312/maintaining-state-on-tree-component-while-updating-remote-data/comment-page-1/#comment-92</link>
		<dc:creator>Daniel Eneström</dc:creator>
		<pubDate>Mon, 01 Jun 2009 08:58:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enestrom.com/?p=80#comment-92</guid>
		<description>I have no sample code at the moment, but a side note is that this method only works with array collections and not with XML. My guess at the reason being that using an XML-file the UID-property it searches for would actually behave as &quot;@uid&quot; in an XML node.

My trick to using array collections is a custom made PHP class that while transmitted through AMFPHP behaves as a native array collection, instead of an array.

When I create the array tree in PHP, before passing it to Flex, I convert each array node to ArrayCollection using this class:

&lt;pre lang=&quot;php&quot;&gt;
class ArrayCollection {
	var $_explicitType = &quot;flex.messaging.io.ArrayCollection&quot;;
	var $source = array();
	
	function ArrayCollection( $array )
	{
		if( !isset( $array ) )
		{
			$array = array();
		}
		$this-&gt;source = $array;
	}
}
&lt;/pre&gt;

Usage would thus be: 
$node = new ArrayCollection( $myarray );

Hope this helps.</description>
		<content:encoded><![CDATA[<p>I have no sample code at the moment, but a side note is that this method only works with array collections and not with XML. My guess at the reason being that using an XML-file the UID-property it searches for would actually behave as &#8220;@uid&#8221; in an XML node.</p>
<p>My trick to using array collections is a custom made PHP class that while transmitted through AMFPHP behaves as a native array collection, instead of an array.</p>
<p>When I create the array tree in PHP, before passing it to Flex, I convert each array node to ArrayCollection using this class:</p>
<pre lang="php">
class ArrayCollection {
	var $_explicitType = "flex.messaging.io.ArrayCollection";
	var $source = array();

	function ArrayCollection( $array )
	{
		if( !isset( $array ) )
		{
			$array = array();
		}
		$this->source = $array;
	}
}
</pre>
<p>Usage would thus be:<br />
$node = new ArrayCollection( $myarray );</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThaStyle</title>
		<link>http://blog.enestrom.com/20090312/maintaining-state-on-tree-component-while-updating-remote-data/comment-page-1/#comment-91</link>
		<dc:creator>ThaStyle</dc:creator>
		<pubDate>Mon, 01 Jun 2009 08:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.enestrom.com/?p=80#comment-91</guid>
		<description>Great i stumpled on this issue, indeed the other bypasses are alot more complicated, better to store the uids, do you happen to have some sample code ??
would be deeply apreciated... and do you send raw xml or array collections, and how do you optain levels??
i worked on something that had 3 static depth levels, but would like a real recursive solution, thanks again...
Peter</description>
		<content:encoded><![CDATA[<p>Great i stumpled on this issue, indeed the other bypasses are alot more complicated, better to store the uids, do you happen to have some sample code ??<br />
would be deeply apreciated&#8230; and do you send raw xml or array collections, and how do you optain levels??<br />
i worked on something that had 3 static depth levels, but would like a real recursive solution, thanks again&#8230;<br />
Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>
