<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kalen Gibbons &#187; Bugs</title>
	<atom:link href="http://www.kalengibbons.com/blog/index.php/category/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kalengibbons.com/blog</link>
	<description>The Dead Tree Blog</description>
	<lastBuildDate>Wed, 10 Mar 2010 07:28:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Update: Solution to disappearing data in your itemRenderer</title>
		<link>http://www.kalengibbons.com/blog/index.php/2008/12/update-solution-to-disappearing-data-in-your-itemrenderer2/</link>
		<comments>http://www.kalengibbons.com/blog/index.php/2008/12/update-solution-to-disappearing-data-in-your-itemrenderer2/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 03:18:40 +0000</pubDate>
		<dc:creator>Kalen Gibbons</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[dataChange]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[validateNow]]></category>

		<guid isPermaLink="false">http://www.kalengibbons.com/blog2/?p=125</guid>
		<description><![CDATA[In a previous post I explained how a rendering bug in Flex was causing items to disappear in an itemRenderer. In the example below, you can see that when you scroll, the items in the list disappear.&#160; This is caused by the varying heights of the elements.&#160; If you explicitly set the height for each [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a title="Disappearing data in your itemRenderer?" href="/blog/post.cfm/disappearing-data-in-your-itemrenderer" mce_href="/blog/post.cfm/disappearing-data-in-your-itemrenderer" target="_self">previous post</a> I explained how a rendering bug in Flex was causing items to disappear in an itemRenderer. In the example below, you can see that when you scroll, the items in the list disappear.&nbsp; This is caused by the varying heights of the elements.&nbsp; If you explicitly set the height for each element or set variableRowHeights to false, then the problem goes away.</p>
<p><center><br />
<iframe height="230" frameborder="0" width="310" src="/assets/pages/itemRenderer1.html"></iframe><br />
</center><br />
<br/></p>
<p>What was causing the problem was apparent but the solution was not.&nbsp; Thankfully, Olivier Lalonde was nice enough to shed some light on an easy fix.&nbsp; The itemRenderer needs to be validated as the user scrolls.&nbsp; So, as Olivier suggests, you simply need to listen for the dataChange event and execute the validateNow() function.</p>
<p>You can see in the example below that the list now has varying row heights&#8230; and the data no longer disappears. NICE!&nbsp; The key point to focus on here is the following line: &lt;mx:VBox <span style="font-weight: bold;" mce_style="font-weight:bold">dataChange=&#8221;validateNow()&#8221;</span> verticalGap=&#8221;0&#8243;&gt;</p>
<div class="code">
<span class="mxmlComponent">&lt;mx:List</span> </p>
<div class="indent">
dataProvider=&#8221;<span class="mxmlString">{</span>myData.item<span class="mxmlString">}</span>&#8220;<br />
variableRowHeight=&#8221;<span class="mxmlString">true</span>&#8220;<br />
alternatingItemColors=&#8221;<span class="mxmlString">['#FFFFFF','#E6EEF3']</span>&#8220;<br />
width=&#8221;<span class="mxmlString">100%</span>&#8220;<br />
height=&#8221;<span class="mxmlString">100%</span>&#8220;<span class="mxmlComponent">&gt;</span>
<p>&nbsp;</p>
<p><span class="mxmlComponent">&lt;mx:itemRenderer&gt;</span></p>
<div class="indent">
<span class="mxmlSpecialString">&lt;mx:Component&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:VBox</span> verticalGap=&#8221;<span class="mxmlString">0</span>&#8221; dataChange=&#8221;validateNow()&#8221;<span class="mxmlComponent">&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:HBox&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:Label</span> text=&#8221;<span class="mxmlString">{</span>data.Label<span class="mxmlString">}</span>&#8221; fontWeight=&#8221;<span class="mxmlString">bold</span>&#8221; <span class="mxmlComponent">/&gt;</span><br/><br />
<span class="mxmlComponent">&lt;mx:Label</span> text=&#8221;<span class="mxmlString">{</span>data.date<span class="mxmlString">}</span>&#8221; color=&#8221;<span class="mxmlString">#999999</span>&#8221; <span class="mxmlComponent">/&gt;</span>
</div>
<p><span class="mxmlComponent">&lt;/mx:HBox&gt;</span><br />
<span class="mxmlComponent">&lt;mx:Text</span> text=&#8221;<span class="mxmlString">{</span>data.description<span class="mxmlString">}</span>&#8221; width=&#8221;<span class="mxmlString">100%</span>&#8221; <span class="mxmlComponent">/&gt;</span>
</div>
<p><span class="mxmlComponent">&lt;/mx:VBox&gt;</span>
</div>
<p><span class="mxmlSpecialString">&lt;/mx:Component&gt;</span>
</div>
<p><span class="mxmlComponent">&lt;/mx:itemRenderer&gt;</span>
</div>
<p>&nbsp;</p>
<p><span class="mxmlComponent">&lt;/mx:List&gt;</span>
</div>
<p><br/><br />
<center><br />
<iframe height="230" frameborder="0" width="400" src="/assets/pages/itemRenderer3.html"></iframe><br />
<center><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kalengibbons.com/blog/index.php/2008/12/update-solution-to-disappearing-data-in-your-itemrenderer2/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Disappearing data in your itemRenderer?</title>
		<link>http://www.kalengibbons.com/blog/index.php/2008/10/disappearing-data-in-your-itemrenderer/</link>
		<comments>http://www.kalengibbons.com/blog/index.php/2008/10/disappearing-data-in-your-itemrenderer/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 03:11:40 +0000</pubDate>
		<dc:creator>Kalen Gibbons</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[variableRowHeight]]></category>

		<guid isPermaLink="false">http://www.kalengibbons.com/blog2/?p=48</guid>
		<description><![CDATA[Note: An update to this post has been posted here. It provides a better solution than the one offered below, so I recommend you check it out. Although I love Flex, it can still be a bit buggy at times. I was working with an itemRenderer the other day and came across some very odd [...]]]></description>
			<content:encoded><![CDATA[<p class="notice">Note: An update to this post has been posted <a href="http://www.kalengibbons.com/blog/post.cfm/update-solution-to-disappearing-data-in-your-itemrenderer">here</a>.  It provides a better solution than the one offered below, so I recommend you check it out.</p>
<p>Although I love Flex, it can still be a bit buggy at times.  I was working with an itemRenderer the other day and came across some very odd behavior.  I had a list using an itemRenderer and when the data originally loaded everything was fine, but whenever I scrolled some of the data started disappearing.  You can see this demonstrated in the sample below.</p>
<p><br/></p>
<table border="0">
<tr>
<td>
<iframe src="/assets/pages/itemRenderer1.html" frameborder="0" width="310" height="230"></iframe>
</td>
<td>
<div style="margin-left: 5px;" class="code">
<span class="mxmlComponent">&lt;mx:List</span> dataProvider=&quot;<span class="mxmlString">{</span>myData.item<span class="mxmlString">}</span>&quot;</p>
<div class="indent3">variableRowHeight=&quot;<span class="mxmlString">true</span>&quot;<br />
alternatingItemColors=&quot;<span class="mxmlString">['#FFFFFF','#E6EEF3']</span>&quot;<br />
width=&quot;<span class="mxmlString">100%</span>&quot;<br />
height=&quot;<span class="mxmlString">100%</span>&quot;<span class="mxmlComponent">&gt;</span></div>
<p>&nbsp;</p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:itemRenderer&gt;</span></p>
<div class="indent">
<span class="mxmlSpecialString">&lt;mx:Component&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:VBox</span> verticalGap=&quot;<span class="mxmlString">0</span>&quot;&gt;</p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:HBox&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:Label</span> text=&quot;<span class="mxmlString">{</span>data.Label<span class="mxmlString">}</span>&quot; fontWeight=&quot;<span class="mxmlString">bold</span>&quot; <span class="mxmlComponent">/&gt;</span><br />
<span class="mxmlComponent">&lt;mx:Label</span> text=&quot;<span class="mxmlString">{</span>data.date<span class="mxmlString">}</span>&quot; color=&quot;<span class="mxmlString">#999999</span>&quot; <span class="mxmlComponent">/&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:HBox&gt;</span><br />
<span class="mxmlComponent">&lt;mx:Text</span> text=&quot;<span class="mxmlString">{</span>data.description<span class="mxmlString">}</span>&quot; width=&quot;<span class="mxmlString">100%</span>&quot; <span class="mxmlComponent">/&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:VBox&gt;</span></div>
<p><span class="mxmlSpecialString">&lt;/mx:Component&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:itemRenderer&gt;</span>
</div>
<p><span class="mxmlComponent">&lt;/mx:List&gt;</span>
</div>
</td>
</tr>
</table>
<p>
Apparently, Flex likes to have all the items in a list the same height; so when an item such as the Text field in the example causes variation, Flex simply doesn&#8217;t display it. I found that the easiest way to remedy the issue was to set explicit heights for the items in the renderer. Here is an example of how it works with the height explicitly set:</p>
<p><br/></p>
<table border="0">
<tr>
<td>
<iframe src="/assets/pages/itemRenderer2.html" frameborder="0" width="310" height="230"></iframe>
</td>
<td>
<div style="margin-left: 5px;" class="code">
<span class="mxmlComponent">&lt;mx:List</span> dataProvider=&quot;<span class="mxmlString">{</span>myData.item<span class="mxmlString">}</span>&quot;</p>
<div class="indent3">variableRowHeight=&quot;<span class="mxmlString">true</span>&quot;<br />
alternatingItemColors=&quot;<span class="mxmlString">['#FFFFFF','#E6EEF3']</span>&quot;<br />
width=&quot;<span class="mxmlString">100%</span>&quot;<br />
height=&quot;<span class="mxmlString">100%</span>&quot;<span class="mxmlComponent">&gt;</span></div>
<p>&nbsp;</p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:itemRenderer&gt;</span></p>
<div class="indent">
<span class="mxmlSpecialString">&lt;mx:Component&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:VBox</span> verticalGap=&quot;<span class="mxmlString">0</span>&quot;&gt;</p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:HBox&gt;</span></p>
<div class="indent">
<span class="mxmlComponent">&lt;mx:Label</span> text=&quot;<span class="mxmlString">{</span>data.Label<span class="mxmlString">}</span>&quot; fontWeight=&quot;<span class="mxmlString">bold</span>&quot; <span class="mxmlComponent">/&gt;</span><br />
<span class="mxmlComponent">&lt;mx:Label</span> text=&quot;<span class="mxmlString">{</span>data.date<span class="mxmlString">}</span>&quot; color=&quot;<span class="mxmlString">#999999</span>&quot; <span class="mxmlComponent">/&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:HBox&gt;</span><br />
<span class="mxmlComponent">&lt;mx:Text</span> text=&quot;<span class="mxmlString">{</span>data.description<span class="mxmlString">}</span>&quot; width=&quot;<span class="mxmlString">100%</span>&quot; height=&quot;<span class="mxmlString">30</span>&quot; <span class="mxmlComponent">/&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:VBox&gt;</span></div>
<p><span class="mxmlSpecialString">&lt;/mx:Component&gt;</span></div>
<p><span class="mxmlComponent">&lt;/mx:itemRenderer&gt;</span>
</div>
<p><span class="mxmlComponent">&lt;/mx:List&gt;</span>
</div>
</td>
</tr>
</table>
<p>
Now, this isn&#8217;t a perfect solution.  What we are doing here is effectively the same thing as setting variableRowHeight to false; thus making all the items in the List the same height.  So if anybody has a better solution for this issue please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kalengibbons.com/blog/index.php/2008/10/disappearing-data-in-your-itemrenderer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Yet another reason for disappearing background images in IE6</title>
		<link>http://www.kalengibbons.com/blog/index.php/2008/06/yet-another-reason-for-disappearing-background-images-in-ie6/</link>
		<comments>http://www.kalengibbons.com/blog/index.php/2008/06/yet-another-reason-for-disappearing-background-images-in-ie6/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 03:57:18 +0000</pubDate>
		<dc:creator>Kalen Gibbons</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.kalengibbons.com/blog2/?p=31</guid>
		<description><![CDATA[I was bit by another IE bug the other day; no matter how much I work with IE I never seem to be immune. That may be due to the fact that IE has sooo many problems. On this occasion several background images were disappearing in IE6. I tried the common solutions first: relative positioning, [...]]]></description>
			<content:encoded><![CDATA[<p>I was bit by another IE bug the other day; no matter how much I work with IE I never seem to be immune.  That may be due to the fact that IE has sooo many problems.  On this occasion several background images were disappearing in IE6.  I tried the common solutions first: relative positioning, removing floats, setting widths, etc. and nothing worked.  It took me quite a while to uncover the culprit.</p>
<div class="code">
<p><span class="mxmlSpecialString">href=</span><span class="mxmlComponent">&quot;javascript: void(0);&quot;</span></p>
<p>&nbsp;</p>
<p>//I was using it in a common manner:<br />
<span class="mxmlSpecialString">&lt;a onclick=</span><span class="mxmlComponent">&quot;switchTabs(&#8216;comments&#8217;)&quot;</span><span class="mxmlSpecialString"> href=</span><span class="mxmlComponent">&quot;javascript: void(0);&quot;</span><span class="mxmlSpecialString">&gt;</span>Comments<span class="mxmlSpecialString">&lt;/a&gt;</span>
</div>
<p>
Once I removed the <strong>href=&#8221;javascript: void(0);&#8221;</strong> from the link everything worked fine. I had searched the Internet for days trying to find the solution to this bug and never found a thing.  This is probably because not too many people use <strong>href=&#8221;javascript: void(0);&#8221;</strong>&#8230; and now I know why.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kalengibbons.com/blog/index.php/2008/06/yet-another-reason-for-disappearing-background-images-in-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
