<?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: Flex 2 DataGrid ItemRenderers are re-used! Warning!!!</title>
	<atom:link href="http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/</link>
	<description>Blog about pretty much everything</description>
	<lastBuildDate>Sat, 04 Feb 2012 15:05:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Patrick</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-1998</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Wed, 22 Dec 2010 18:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-1998</guid>
		<description>Wow, this helped me out a lot! Thank you so much. I was using this with an image (anytime there was a value was set to 1 it would show an alert icon). However, as soon as I horizontally scrolled the alert icon would jump to random cells. Problem fixed thanks to the super.data = value;</description>
		<content:encoded><![CDATA[<p>Wow, this helped me out a lot! Thank you so much. I was using this with an image (anytime there was a value was set to 1 it would show an alert icon). However, as soon as I horizontally scrolled the alert icon would jump to random cells. Problem fixed thanks to the super.data = value;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-907</link>
		<dc:creator>david</dc:creator>
		<pubDate>Sun, 24 Oct 2010 15:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-907</guid>
		<description>Steve, i think you just saved my life. I knew something was being reused, but I couldn&#039;t pinpoint where that was happening. I had a custom cell renderer adding a movie clip to index 0, and thus always putting it behind the last mc. I now clear out previous children before adding a new mc in the renderer.  This issue seems to go hand in hand with the crap garbage collection that as3 has.

Anyways, great blog article. it was the lightbulb fix to my problem!</description>
		<content:encoded><![CDATA[<p>Steve, i think you just saved my life. I knew something was being reused, but I couldn&#8217;t pinpoint where that was happening. I had a custom cell renderer adding a movie clip to index 0, and thus always putting it behind the last mc. I now clear out previous children before adding a new mc in the renderer.  This issue seems to go hand in hand with the crap garbage collection that as3 has.</p>
<p>Anyways, great blog article. it was the lightbulb fix to my problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius Filo</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-334</link>
		<dc:creator>Marius Filo</dc:creator>
		<pubDate>Tue, 17 Aug 2010 10:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-334</guid>
		<description>Thanks a lot, Steve !
Your post helped me a lot to keep my mental sanity ;)</description>
		<content:encoded><![CDATA[<p>Thanks a lot, Steve !<br />
Your post helped me a lot to keep my mental sanity <img src='http://www.stevekamerman.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flexhunter</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-173</link>
		<dc:creator>flexhunter</dc:creator>
		<pubDate>Mon, 12 Jul 2010 11:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-173</guid>
		<description>Thanks mate!!! it solved my problem..</description>
		<content:encoded><![CDATA[<p>Thanks mate!!! it solved my problem..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Xie</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-87</link>
		<dc:creator>James Xie</dc:creator>
		<pubDate>Wed, 14 Oct 2009 11:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-87</guid>
		<description>Thanks a lot for your tip, it solves my problem [:)]</description>
		<content:encoded><![CDATA[<p>Thanks a lot for your tip, it solves my problem [:)]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kapil Kaushik</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-86</link>
		<dc:creator>Kapil Kaushik</dc:creator>
		<pubDate>Sun, 12 Jul 2009 19:20:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-86</guid>
		<description>Hi Steve,

Thanks a lot for the tutorial !!

I am stuck with one problem for sometime now, and was hoping if you could help me out.

I am trying to populate a data grid using xml, one of the columns of which is a combobox. However, I also want the combobox to be updated dynamically (depending upon the data from the xml).

I am using flex 3.3 mx.controls.datagrid component.

Here is the code snippet for what I am trying to do:

var propertyColumn:DataGridColumn = new DataGridColumn(&quot;Name&quot;);
propertyColumn.editable = false;
propertyColumn.width = 60;
var valueColumn:DataGridColumn = new DataGridColumn(&quot;Value&quot;);
valueColumn.editable = true;
propertyColumn.width = 60;
var unitColumn:DataGridColumn = new DataGridColumn(&quot;Unit&quot;);
unitColumn.itemRenderer = new ClassFactory(Unit);

Here Unit is an class which implements Combobox

public class Unit extends ComboBox
{
private var _displayList:ArrayCollection;

public function Unit()
{
_displayList = new ArrayCollection();
_displayList.addItem(&quot;N/A&quot;);

this.selectedIndex = 0;
this.dataProvider = _displayList;
}

public function setDisplayList(list:ArrayCollection):void
{
_displayList = list;
this.dataProvider = _displayList;
this.selectedIndex = 0;
}
}

Then I create an array object which contains a list of values for this, and assign it to the dataprovider of the data grid. All the other values in the grid get displayed properly except for the combobox. The reason I checked was that it creates a new item for the unit when I assign my data to the dataprovider, and does not take my previous data.

I understand that what is happening is correct (because I am doing new ClassFactory(Unit) while creating itemrenderer), but dont know what I need to do to pass the data I provided to the itemrenderer. I tried to add the &quot;override public function set data/dataProvider&quot; functions, but still it did not work.

Any help/feedback that you may give would be really really appreciated !!!

Thanks in advance,
Kapil</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Thanks a lot for the tutorial !!</p>
<p>I am stuck with one problem for sometime now, and was hoping if you could help me out.</p>
<p>I am trying to populate a data grid using xml, one of the columns of which is a combobox. However, I also want the combobox to be updated dynamically (depending upon the data from the xml).</p>
<p>I am using flex 3.3 mx.controls.datagrid component.</p>
<p>Here is the code snippet for what I am trying to do:</p>
<p>var propertyColumn:DataGridColumn = new DataGridColumn(&quot;Name&quot;);<br />
propertyColumn.editable = false;<br />
propertyColumn.width = 60;<br />
var valueColumn:DataGridColumn = new DataGridColumn(&quot;Value&quot;);<br />
valueColumn.editable = true;<br />
propertyColumn.width = 60;<br />
var unitColumn:DataGridColumn = new DataGridColumn(&quot;Unit&quot;);<br />
unitColumn.itemRenderer = new ClassFactory(Unit);</p>
<p>Here Unit is an class which implements Combobox</p>
<p>public class Unit extends ComboBox<br />
{<br />
private var _displayList:ArrayCollection;</p>
<p>public function Unit()<br />
{<br />
_displayList = new ArrayCollection();<br />
_displayList.addItem(&quot;N/A&quot;);</p>
<p>this.selectedIndex = 0;<br />
this.dataProvider = _displayList;<br />
}</p>
<p>public function setDisplayList(list:ArrayCollection):void<br />
{<br />
_displayList = list;<br />
this.dataProvider = _displayList;<br />
this.selectedIndex = 0;<br />
}<br />
}</p>
<p>Then I create an array object which contains a list of values for this, and assign it to the dataprovider of the data grid. All the other values in the grid get displayed properly except for the combobox. The reason I checked was that it creates a new item for the unit when I assign my data to the dataprovider, and does not take my previous data.</p>
<p>I understand that what is happening is correct (because I am doing new ClassFactory(Unit) while creating itemrenderer), but dont know what I need to do to pass the data I provided to the itemrenderer. I tried to add the &quot;override public function set data/dataProvider&quot; functions, but still it did not work.</p>
<p>Any help/feedback that you may give would be really really appreciated !!!</p>
<p>Thanks in advance,<br />
Kapil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aravind</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-85</link>
		<dc:creator>Aravind</dc:creator>
		<pubDate>Thu, 15 Jan 2009 20:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-85</guid>
		<description>Hi Steve,

Very good examples.
I have a similar problem in my project.

public class Comboboxrenderer extends ComboBox

I have created a custom item renderer combo box and added it to the data grid coulm like below.
var col1:DataGridColumn = new DataGridColumn(&quot;@col1&quot;);
col1.itemRenderer = new ClassFactory(Comboboxrenderer);

Now I am facing problems in setting the combo box to normal one. 

I have written every thing in action script files. Is that creating problems.?

Please help me.
</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Very good examples.<br />
I have a similar problem in my project.</p>
<p>public class Comboboxrenderer extends ComboBox</p>
<p>I have created a custom item renderer combo box and added it to the data grid coulm like below.<br />
var col1:DataGridColumn = new DataGridColumn(&quot;@col1&quot;);<br />
col1.itemRenderer = new ClassFactory(Comboboxrenderer);</p>
<p>Now I am facing problems in setting the combo box to normal one. </p>
<p>I have written every thing in action script files. Is that creating problems.?</p>
<p>Please help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amazonotter</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-84</link>
		<dc:creator>amazonotter</dc:creator>
		<pubDate>Tue, 27 May 2008 17:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-84</guid>
		<description>Hi,

I wanted to thank you for your blog entry because it has helped me tremendously.  I now have a slightly different problem though and I cannot, for the life of me, figure out what is going on.  I believe it is a similar problem that this entry resolves.

I have an &lt;AdvancedDataGrid&gt; that is grouped, meaning that the dataprovider is a GroupingCollection but it gets more complicated. In this Advanced Data Grid, I am using a &lt;AdvancedDataGridRendererProvider&gt; which renders a component called &quot;thumbNailRenderer&quot;.

The reason behind this is that I needed to display a listing of Departments that are grouped and in each of these departments I need to display a row of thumbnail images of the employees.

I actually have all this working, but my problem is that in the &quot;thumbNailRenderer&quot; component, there is an &lt;mx:Image source=&quot;{data.ntlogon}.jpg&quot;/&gt; call.  In my style sheet, i&#039;m doing a brokenImageSkin:Embed(&quot;nophotoman.gif&quot;) on this &lt;mx:Image&gt; node.  So whenever there the source jpg cannot be found, I wanted to show a generic no_photo.jpg image instead of the broken image icon that shows by default whenever an image cannot be found.  I know my path to the &quot;nophotoman.gif&quot; image is correct but the image does not show.

I&#039;ve also tried using the &lt;mx:Image ioError=&quot;&quot;/&gt; call but when I go this route the AdvancedDataGrid starts refreshing like crazy which is similar to the problem that this blog entry resolves.

Any guidance or advice would be very very much appreciated,

Thank You</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I wanted to thank you for your blog entry because it has helped me tremendously.  I now have a slightly different problem though and I cannot, for the life of me, figure out what is going on.  I believe it is a similar problem that this entry resolves.</p>
<p>I have an &lt;AdvancedDataGrid&gt; that is grouped, meaning that the dataprovider is a GroupingCollection but it gets more complicated. In this Advanced Data Grid, I am using a &lt;AdvancedDataGridRendererProvider&gt; which renders a component called &quot;thumbNailRenderer&quot;.</p>
<p>The reason behind this is that I needed to display a listing of Departments that are grouped and in each of these departments I need to display a row of thumbnail images of the employees.</p>
<p>I actually have all this working, but my problem is that in the &quot;thumbNailRenderer&quot; component, there is an &lt;mx:Image source=&quot;{data.ntlogon}.jpg&quot;/&gt; call.  In my style sheet, i&#039;m doing a brokenImageSkin:Embed(&quot;nophotoman.gif&quot;) on this &lt;mx:Image&gt; node.  So whenever there the source jpg cannot be found, I wanted to show a generic no_photo.jpg image instead of the broken image icon that shows by default whenever an image cannot be found.  I know my path to the &quot;nophotoman.gif&quot; image is correct but the image does not show.</p>
<p>I&#039;ve also tried using the &lt;mx:Image ioError=&quot;&quot;/&gt; call but when I go this route the AdvancedDataGrid starts refreshing like crazy which is similar to the problem that this blog entry resolves.</p>
<p>Any guidance or advice would be very very much appreciated,</p>
<p>Thank You</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Riley</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-83</link>
		<dc:creator>William Riley</dc:creator>
		<pubDate>Thu, 27 Mar 2008 00:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-83</guid>
		<description>Many thanks! This was driving me crazzzzyy and nothing in the docs seemed to help / point me in the right direction, till I found you comments. I kept thinking somehow it was the passed in data.

-Bill
</description>
		<content:encoded><![CDATA[<p>Many thanks! This was driving me crazzzzyy and nothing in the docs seemed to help / point me in the right direction, till I found you comments. I kept thinking somehow it was the passed in data.</p>
<p>-Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Kamerman</title>
		<link>http://www.stevekamerman.com/2008/01/flex-2-datagrid-itemrenderers-are-re-used-warning/comment-page-1/#comment-82</link>
		<dc:creator>Steve Kamerman</dc:creator>
		<pubDate>Wed, 05 Mar 2008 02:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.teratechnologies.net/stevekamerman/index.php?entry=entry080110-093749#comment-82</guid>
		<description>Hi Tim - just make sure you set your comboboxes in the set data function:

[code]
public override function set data(value:Object):void{
  // This will fire off the FlexEvent.DATA_CHANGE Event
  super.data = value;
  // if the value is null this cell is empty
  if(value == null){
    // clear all the controls
    [b]myComboBox.selected = false;[/b]
    return;
  }
  // set the controls with this data
  [b]myComboBox.selected = data.myComboBoxSouce;[/b]
}
[/code]</description>
		<content:encoded><![CDATA[<p>Hi Tim &#8211; just make sure you set your comboboxes in the set data function:</p>
<p>[code]<br />
public override function set data(value:Object):void{<br />
  // This will fire off the FlexEvent.DATA_CHANGE Event<br />
  super.data = value;<br />
  // if the value is null this cell is empty<br />
  if(value == null){<br />
    // clear all the controls<br />
    [b]myComboBox.selected = false;[/b]<br />
    return;<br />
  }<br />
  // set the controls with this data<br />
  [b]myComboBox.selected = data.myComboBoxSouce;[/b]<br />
}<br />
[/code]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

