<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<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/"
	>

<channel>
	<title>739 Saint Louis St</title>
	<link>http://blog.739saintlouis.com</link>
	<description></description>
	<pubDate>Fri, 25 Jan 2008 15:49:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>New year - a bit slow out of the gate&#8230;here&#8217;s what I have been doing.</title>
		<link>http://blog.739saintlouis.com/2008/01/25/new-year-a-bit-slow-out-of-the-gateheres-what-i-have-been-doing/</link>
		<comments>http://blog.739saintlouis.com/2008/01/25/new-year-a-bit-slow-out-of-the-gateheres-what-i-have-been-doing/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 15:49:43 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Uncategorized</category><dc:subject>Adobe Air</dc:subject><dc:subject>AIR</dc:subject><dc:subject>Blaze Data Services</dc:subject><dc:subject>flash</dc:subject><dc:subject>Flash Player</dc:subject><dc:subject>Flex</dc:subject><dc:subject>Flex Builder</dc:subject><dc:subject>flexmonkeypatches.com</dc:subject><dc:subject>LCDS BlazeDS</dc:subject><dc:subject>LiveCycle Data Services</dc:subject><dc:subject>Uncategorized</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2008/01/25/new-year-a-bit-slow-out-of-the-gateheres-what-i-have-been-doing/</guid>
		<description><![CDATA[So it is almost February already! Where did January go? I&#8217;ve been a bit slow out of the gate this year as far as keeping up a decent pace in posting helpful samples to my blog. Actually, I have been working on things behind the scenes, a few details of which I will reveal now. [...]]]></description>
			<content:encoded><![CDATA[<p>So it is almost February already! Where did January go? I&#8217;ve been a bit slow out of the gate this year as far as keeping up a decent pace in posting helpful samples to my blog. Actually, I have been working on things behind the scenes, a few details of which I will reveal now. I have launched a new blog on a new domain. The content is to be all &#8220;work&#8221; related, so it will be about Flex/Flash Player/Adobe AIR, LiveCycle Data Services/Blaze DS/ColdFusion and other fun technologies. I&#8217;ve also been working on an AIR app which I hope to get out at least in a fairly stable beta form around the same time that Flex3/AIR releases. It will most likely be open source and hosted on Google Code. I will also be compiling a library of useful components, extensions to components and monkey patches to the Flex framework. This new blog and content will all be available on:</p>
<p><a href="http://flexmonkeypatches.com">http://flexmonkeypatches.com</a></p>
<p>All old posts on http:blog.739SaintLouis.com should link to or redirect to the same content on my new site. I will leave my old site up for an undetermined length of time with the intent of transforming it content-wise into a more personal blog (time permitting.)</p>
<p>Regards,</p>
<p>-Kyle</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2008/01/25/new-year-a-bit-slow-out-of-the-gateheres-what-i-have-been-doing/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Flex SDK, FDS, LCDS version detection - Adobe AIR application - UPDATED for AIR beta3 and Flex SDK 3 beta3</title>
		<link>http://blog.739saintlouis.com/2007/12/13/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated-for-air-beta3-and-flex-sdk-3-beta3/</link>
		<comments>http://blog.739saintlouis.com/2007/12/13/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated-for-air-beta3-and-flex-sdk-3-beta3/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 22:22:44 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>Adobe Air</dc:subject><dc:subject>AIR</dc:subject><dc:subject>Apollo</dc:subject><dc:subject>compilation</dc:subject><dc:subject>FDS</dc:subject><dc:subject>Flex</dc:subject><dc:subject>Flex Data Services</dc:subject><dc:subject>hot fix</dc:subject><dc:subject>jar</dc:subject><dc:subject>LCDS</dc:subject><dc:subject>SDK</dc:subject><dc:subject>swc</dc:subject><dc:subject>version</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/12/13/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated-for-air-beta3-and-flex-sdk-3-beta3/</guid>
		<description><![CDATA[Adobe Flex sdk beta 3 and Adobe AIR beta 3 just release to Adobe Labs yesterday, so I have updated my version checker AIR application to detect the new SDK and also compiled the app against the new AIR classes targeting the new AIR runtime.
All other blog references will be pointing to this new version [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe Flex sdk beta 3 and Adobe AIR beta 3 just release to Adobe Labs yesterday, so I have updated my version checker AIR application to detect the new SDK and also compiled the app against the new AIR classes targeting the new AIR runtime.</p>
<p>All other blog references will be pointing to this new version <a href="http://blog.739saintlouis.com/wp-content/code/Flex3.0b2/FlexVersionChecker/FlexVersionChecker.air">>>>> here <<<<<</a>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/12/13/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated-for-air-beta3-and-flex-sdk-3-beta3/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Datagrid popup as itemEditor</title>
		<link>http://blog.739saintlouis.com/2007/12/12/datagrid-popup-as-itemeditor/</link>
		<comments>http://blog.739saintlouis.com/2007/12/12/datagrid-popup-as-itemeditor/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 15:38:04 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>datagrid</dc:subject><dc:subject>Flex</dc:subject><dc:subject>itemEditor</dc:subject><dc:subject>itemRenderer</dc:subject><dc:subject>poup</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/12/12/datagrid-popup-as-itemeditor/</guid>
		<description><![CDATA[This isn&#8217;t as difficult as some may think.  Basically your itemRenderer opens up a popup.  When the renderer creates the popup, it sets an &#8220;opener&#8221; property on the popup pointing back to &#8220;this&#8221;, which is the itemRenderer.  That way, when the editing is finished in the popup, the popup can pass data [...]]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t as difficult as some may think.  Basically your itemRenderer opens up a popup.  When the renderer creates the popup, it sets an &#8220;opener&#8221; property on the popup pointing back to &#8220;this&#8221;, which is the itemRenderer.  That way, when the editing is finished in the popup, the popup can pass data back to a function in the itemRenderer to do the update, close itself, and set focus back to the itemRenderer.</p>
<p>Here is the code for the app:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> xmlns:local=<span style="color: #ff0000;">&quot;*&quot;</span> &gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Array</span> id=<span style="color: #ff0000;">&quot;arr&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters Unicode character code Downloading the latest Adobe Labs version of Flex 3 SDK/Flex Builder 3 (codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control Formatting data tips in a Slide&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;/mx:Array&gt;<br />
&nbsp; &nbsp; &lt;mx:ArrayCollection id=<span style="color: #ff0000;">&quot;AC&quot;</span> source=<span style="color: #ff0000;">&quot;{arr}&quot;</span> /&gt;&nbsp; &nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &lt;mx:DataGrid <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;250&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{AC}&quot;</span> variableRowHeight=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> editable=<span style="color: #ff0000;">&quot;true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn dataField=<span style="color: #ff0000;">&quot;data&quot;</span> headerText=<span style="color: #ff0000;">&quot;ID&quot;</span> editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;125&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editable=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #0066CC;">wordWrap</span>=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headerText=<span style="color: #ff0000;">&quot;Article Name&quot;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itemRenderer=<span style="color: #ff0000;">&quot;MyRenderer&quot;</span> dataField=<span style="color: #ff0000;">&quot;articleName&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:columns&gt;<br />
&nbsp; &nbsp; &lt;/mx:DataGrid&gt;<br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a id="more-72"></a></p>
<p>Here is the itemRenderer:</p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:<span style="color: #0066CC;">Text</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <br />
&nbsp; &nbsp; <span style="color: #0066CC;">implements</span>=<span style="color: #ff0000;">&quot;mx.controls.listClasses.IDropInListItemRenderer&quot;</span> <br />
&nbsp; &nbsp; toolTip=<span style="color: #ff0000;">&quot;Double Click to Edit&#8230;&quot;</span> doubleClick=<span style="color: #ff0000;">&quot;callLater(openPopup)&quot;</span> doubleClickEnabled=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{txt}&quot;</span>&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">DataGrid</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">ListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">BaseListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">managers</span>.<span style="color: #006600;">PopUpManager</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">FlexEvent</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _listData:DataGridListData;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">String</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">pop</span>:Popup</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span> = value;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txt=<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>_listData.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;&nbsp;&nbsp;override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> listData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:BaseListData<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _listData;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> listData<span style="color: #66cc66;">&#40;</span>value:BaseListData<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _listData = DataGridListData<span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> openPopup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">pop</span>= Popup<span style="color: #66cc66;">&#40;</span>PopUpManager.<span style="color: #006600;">createPopUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">owner</span>,Popup,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">pop</span>.<span style="color: #006600;">txt</span>=<span style="color: #0066CC;">this</span>.<span style="color: #006600;">txt</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">pop</span>.<span style="color: #006600;">opener</span>=<span style="color: #0066CC;">this</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> updateDP<span style="color: #66cc66;">&#40;</span>str:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> myDG:DataGrid=<span style="color: #0066CC;">this</span>.<span style="color: #006600;">owner</span> as DataGrid;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> row:<span style="color: #0066CC;">int</span>=_listData.<span style="color: #006600;">rowIndex</span>+myDG.<span style="color: #006600;">verticalScrollPosition</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>_listData.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>=str;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myDG.<span style="color: #006600;">dataProvider</span>.<span style="color: #006600;">itemUpdated</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&lt;/mx:Text&gt;<br />
&nbsp;</div>
<p>Here is the popup:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:TitleWindow xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;350&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;250&quot;</span> showCloseButton=<span style="color: #ff0000;">&quot;false&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;centerMe()&quot;</span><br />
&nbsp; &nbsp; defaultButton=<span style="color: #ff0000;">&quot;{btnSave}&quot;</span>&gt; </p>
<p>&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">managers</span>.<span style="color: #006600;">FocusManager</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">managers</span>.<span style="color: #006600;">PopUpManager</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">String</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> opener:<span style="color: #0066CC;">Object</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> save<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span>opener as MyRenderer<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">updateDP</span><span style="color: #66cc66;">&#40;</span>ta.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cancel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cancel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PopUpManager.<span style="color: #006600;">removePopUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; returnFocus<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> returnFocus<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opener.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> centerMe<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PopUpManager.<span style="color: #006600;">centerPopUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ta.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:TextArea id=<span style="color: #ff0000;">&quot;ta&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{txt}&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;mx:ControlBar&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:HBox&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;btnSave&quot;</span> label=<span style="color: #ff0000;">&quot;save&quot;</span> click=<span style="color: #ff0000;">&quot;save()&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> id=<span style="color: #ff0000;">&quot;btnCancel&quot;</span> label=<span style="color: #ff0000;">&quot;cancel&quot;</span> click=<span style="color: #ff0000;">&quot;cancel()&quot;</span>/&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:HBox&gt;<br />
&nbsp; &nbsp; &lt;/mx:ControlBar&gt;<br />
&lt;/mx:TitleWindow&gt;</p>
<p>&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_dg_editor_popup/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_dg_editor_popup/srcview/__739stl_dg_editor_popup.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="500" height="550">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_dg_editor_popup/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_dg_editor_popup/app.swf" type="application/x-shockwave-flash" width="500" height="550" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/12/12/datagrid-popup-as-itemeditor/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Adding a row to the top of a sorted DataGrid</title>
		<link>http://blog.739saintlouis.com/2007/12/11/adding-a-row-to-the-top-of-a-sorted-datagrid/</link>
		<comments>http://blog.739saintlouis.com/2007/12/11/adding-a-row-to-the-top-of-a-sorted-datagrid/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 15:00:42 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>arraycollection</dc:subject><dc:subject>bytearray</dc:subject><dc:subject>clone</dc:subject><dc:subject>collection</dc:subject><dc:subject>datagrid</dc:subject><dc:subject>Flex</dc:subject><dc:subject>mxml</dc:subject><dc:subject>sort</dc:subject><dc:subject>sorted</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/12/11/adding-a-row-to-the-top-of-a-sorted-datagrid/</guid>
		<description><![CDATA[I had a customer asking how to do this.
Sorting the datagrid sorts the underlying dataprovider.
Remember that things like ArrayCollections are just essentially views of the data.  So adding an element to the underlying data, regardless of the position at which you add the new item, will not affect its position in the &#8220;view&#8221;.  [...]]]></description>
			<content:encoded><![CDATA[<p>I had a customer asking how to do this.<br />
Sorting the datagrid sorts the underlying dataprovider.<br />
Remember that things like ArrayCollections are just essentially views of the data.  So adding an element to the underlying data, regardless of the position at which you add the new item, will not affect its position in the &#8220;view&#8221;.  It will get added in its sorted position if the view is showing sorted data.  The workaround to this is show in the simple sample below:</p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">collections</span>.<span style="color: #006600;">ArrayCollection</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> objs:ArrayCollection = <span style="color: #000000; font-weight: bold;">new</span> ArrayCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * initialize the dataprovider<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;carry&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;fred&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;henry&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;issac&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;mary&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;tom&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;tom2&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>obj<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dg.<span style="color: #006600;">dataProvider</span> = objs;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ByteArray</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clone<span style="color: #66cc66;">&#40;</span>source:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">var</span> myBA:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;myBA.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>source<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;myBA.<span style="color: #0066CC;">position</span> = <span style="color: #cc66cc;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span>myBA.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addObj<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> temp:<span style="color: #0066CC;">Array</span> = clone<span style="color: #66cc66;">&#40;</span>objs.<span style="color: #006600;">toArray</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs=<span style="color: #000000; font-weight: bold;">new</span> ArrayCollection<span style="color: #66cc66;">&#40;</span>temp<span style="color: #66cc66;">&#41;</span>;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dg.<span style="color: #006600;">dataProvider</span>=objs;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> obj:<span style="color: #0066CC;">Object</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&#8216;&#8217;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objs.<span style="color: #006600;">addItemAt</span><span style="color: #66cc66;">&#40;</span>obj, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;150&quot;</span> label=<span style="color: #ff0000;">&quot;Add New Row&quot;</span> click=<span style="color: #ff0000;">&quot;addObj()&quot;</span> /&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:DataGrid id=<span style="color: #ff0000;">&quot;dg&quot;</span> editable=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;50%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;80%&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn headerText=<span style="color: #ff0000;">&quot;Name&quot;</span> dataField=<span style="color: #ff0000;">&quot;name&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editable=<span style="color: #ff0000;">&quot;true&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;/mx:columns&gt;<br />
&lt;/mx:DataGrid&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_addrow_to_top_of_sorted_DG/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_addrow_to_top_of_sorted_DG/srcview/_739stl_addrow_to_top_of_sorted_DG.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="500" height="550">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_addrow_to_top_of_sorted_DG/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_addrow_to_top_of_sorted_DG/app.swf" type="application/x-shockwave-flash" width="500" height="550" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/12/11/adding-a-row-to-the-top-of-a-sorted-datagrid/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Detecting when a Flex application loses focus.</title>
		<link>http://blog.739saintlouis.com/2007/12/07/detecting-when-a-flex-application-loses-focus/</link>
		<comments>http://blog.739saintlouis.com/2007/12/07/detecting-when-a-flex-application-loses-focus/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 15:00:56 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>events</dc:subject><dc:subject>Flex</dc:subject><dc:subject>focus</dc:subject><dc:subject>lose focus</dc:subject><dc:subject>mouse event</dc:subject><dc:subject>mouseevent</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/12/07/detecting-when-a-flex-application-loses-focus/</guid>
		<description><![CDATA[I have seen a few people and had a customer ask how to detect when a flex app loses focus.
Here is a sample app that shows the technique and a practical application of this functionality.
When you click and drag a DividedBox separator, if you move the mouse outside the Flex application window, the app should [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen a few people and had a customer ask how to detect when a flex app loses focus.<br />
Here is a sample app that shows the technique and a practical application of this functionality.<br />
When you click and drag a DividedBox separator, if you move the mouse outside the Flex application window, the app should realize this and &#8220;drop&#8221; the separator at that horizontal or vertical position (depending on the orientation of your divider).  It doesn&#8217;t do this automatically (and maybe is should), but it is easily done and demonstrates the technique that can be used for other reasons.</p>
<p>Here is the simple app:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;addListeners(event)&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> lastX:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> lastY:<span style="color: #0066CC;">Number</span>;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addListeners<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">MOUSE_LEAVE</span>, mouseLeave<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">DEACTIVATE</span>,deactivate<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, mouseMove<span style="color: #66cc66;">&#41;</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> removeListeners<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">MOUSE_LEAVE</span>, mouseLeave<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>.<span style="color: #006600;">DEACTIVATE</span>,deactivate<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; systemManager.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, mouseMove<span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mouseMove<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//trace(&quot;move&#8230;&quot;);&nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastX=event.<span style="color: #006600;">stageX</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastY=event.<span style="color: #006600;">stageY</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mouseLeave<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//trace(&quot;left&quot;);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removeListeners<span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> MouseEvent<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,<span style="color: #000000; font-weight: bold;">true</span>,<span style="color: #000000; font-weight: bold;">false</span>,lastX,lastY<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> deactivate<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//trace(&quot;deactivate&quot;);</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removeListeners<span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> MouseEvent<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>,<span style="color: #000000; font-weight: bold;">true</span>,<span style="color: #000000; font-weight: bold;">false</span>,lastX,lastY<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:VDividedBox id=<span style="color: #ff0000;">&quot;div1&quot;</span> dividerPress=<span style="color: #ff0000;">&quot;addListeners(event)&quot;</span> dividerRelease=<span style="color: #ff0000;">&quot;removeListeners(event)&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:VBox <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;300&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;outset&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Something&quot;</span>/&gt;&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:VBox&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:VBox <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;300&quot;</span> borderStyle=<span style="color: #ff0000;">&quot;outset&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:TextArea <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:VBox &gt;<br />
&nbsp; &nbsp; &lt;/mx:VDividedBox&gt;<br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_detect_Flex_app_lose_focus/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2739stl_detect_Flex_app_lose_focus/srcview/__739stl_detect_Flex_app_lose_focus.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="350" height="500">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_detect_Flex_app_lose_focus/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_detect_Flex_app_lose_focus/app.swf" type="application/x-shockwave-flash" width="350" height="500" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/12/07/detecting-when-a-flex-application-loses-focus/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Damn ampersands! - escaping in expressions or using compound/ternary logic expressions</title>
		<link>http://blog.739saintlouis.com/2007/12/05/damn-ampersands-escaping-in-expressions-or-using-compoundternary-logic-expressions/</link>
		<comments>http://blog.739saintlouis.com/2007/12/05/damn-ampersands-escaping-in-expressions-or-using-compoundternary-logic-expressions/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 17:26:25 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category>
	<category>actionscript</category>
	<category>mxml</category><dc:subject>actionscript</dc:subject><dc:subject>ampersands</dc:subject><dc:subject>binding</dc:subject><dc:subject>expression</dc:subject><dc:subject>Flex</dc:subject><dc:subject>logical</dc:subject><dc:subject>logical expressions</dc:subject><dc:subject>mxml</dc:subject><dc:subject>ternary</dc:subject><dc:subject>xml</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/12/05/damn-ampersands-escaping-in-expressions-or-using-compoundternary-logic-expressions/</guid>
		<description><![CDATA[XML and ampersands do not mix well.
Flex uses mxml which is XML.
This can lead to issues when writing binding expressions in mxml tags for component properties when you are trying to write logical expressions using &#8216;and&#8217;.
Here is a simple sample that demonstrates how to escape the ampersands in the expression and how to create a [...]]]></description>
			<content:encoded><![CDATA[<p>XML and ampersands do not mix well.<br />
Flex uses mxml which is XML.<br />
This can lead to issues when writing binding expressions in mxml tags for component properties when you are trying to write logical expressions using &#8216;and&#8217;.</p>
<p>Here is a simple sample that demonstrates how to escape the ampersands in the expression and how to create a logical expression that does not even use &#8216;and&#8217;, but achieves the same result.</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> bOne:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> bTwo:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;(click to toggle) bOne: {bOne}&quot;</span> click=<span style="color: #ff0000;">&quot;bOne=!bOne&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;(click to toggle) bTwo: {bTwo}&quot;</span> click=<span style="color: #ff0000;">&quot;bTwo=!bTwo&quot;</span>/&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:Label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;If bOne and bTwo are true, the buttons below will be Enabled&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;!&#8211;escape the ampersands <span style="color: #b1b100;">for</span> the logical <span style="color: #0066CC;">and</span> operator &#8211;&gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;enabled?&quot;</span> <span style="color: #0066CC;">enabled</span>=<span style="color: #ff0000;">&quot;{(bOne &amp;&amp; bTwo)}&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;!&#8211;or use <span style="color: #0066CC;">this</span> compounded logical statement which will evaluate to the same thing &#8211;&gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;enabled?&quot;</span> <span style="color: #0066CC;">enabled</span>=<span style="color: #ff0000;">&quot;{(bOne ? bTwo : false)}&quot;</span>/&gt;&nbsp;<br />
&nbsp; &nbsp; <br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_Ternary_logic_and_Escape_Ampersand/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_Ternary_logic_and_Escape_Ampersand/srcview/__739stl_Ternary_logic_and_Escape_Ampersand.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="450" height="275">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_Ternary_logic_and_Escape_Ampersand/main.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_Ternary_logic_and_Escape_Ampersand/main.swf" type="application/x-shockwave-flash" width="450" height="275" >
</object>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/12/05/damn-ampersands-escaping-in-expressions-or-using-compoundternary-logic-expressions/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Flex SDK, FDS, LCDS version detection - Adobe AIR application - UPDATED</title>
		<link>http://blog.739saintlouis.com/2007/11/26/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated/</link>
		<comments>http://blog.739saintlouis.com/2007/11/26/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 20:53:54 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category>
	<category>Flex Builder</category>
	<category>Flex Data Services</category><dc:subject>Adobe Air</dc:subject><dc:subject>AIR</dc:subject><dc:subject>Apollo</dc:subject><dc:subject>compilation</dc:subject><dc:subject>FDS</dc:subject><dc:subject>Flex</dc:subject><dc:subject>Flex Builder</dc:subject><dc:subject>Flex Data Services</dc:subject><dc:subject>hot fix</dc:subject><dc:subject>jar</dc:subject><dc:subject>LCDS</dc:subject><dc:subject>SDK</dc:subject><dc:subject>swc</dc:subject><dc:subject>version</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/11/26/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated/</guid>
		<description><![CDATA[I just recently was made aware that there are actually 3 different &#8220;builds&#8221; of Flex SDK &#8220;hotfix 3&#8243; out there.
1.  Originally hotfix 3 was applied to hotfix 2 (updating a few swcs) - version 1
2.  Late summer 2007 it was realized this confused some folks so the hotfix kb article was replaced with [...]]]></description>
			<content:encoded><![CDATA[<p>I just recently was made aware that there are actually 3 different &#8220;builds&#8221; of Flex SDK &#8220;hotfix 3&#8243; out there.<br />
1.  Originally hotfix 3 was applied to hotfix 2 (updating a few swcs) - version 1<br />
2.  Late summer 2007 it was realized this confused some folks so the hotfix kb article was replaced with a full version of the SDK with the fixes applied - version 2<br />
3.  Flex Builder 3 beta 2 shipped with the latest/greatest SDK from the 2.0.1 branch which is an equivalent to hotfix 3 SDK - version 3.</p>
<p>These versions should be functionally identical afaik.</p>
<p>I updated my version checker to detect and differentiate these versions.  I have updated the original blog entry <a href="http://blog.739saintlouis.com/2007/11/12/flex-sdk-fds-lcds-version-detection-adobe-air-application/">here</a> and also have links to the update AIR app <a href="http://blog.739saintlouis.com/wp-content/code/Flex3.0b2/FlexVersionChecker/FlexVersionChecker.air">here</a>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/11/26/flex-sdk-fds-lcds-version-detection-adobe-air-application-updated/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Flex linebreaks in DataGrid itemRenderer and itemEditors</title>
		<link>http://blog.739saintlouis.com/2007/11/26/flex-linebreaks-in-datagrid-itemrenderer-and-itemeditors/</link>
		<comments>http://blog.739saintlouis.com/2007/11/26/flex-linebreaks-in-datagrid-itemrenderer-and-itemeditors/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 15:00:50 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>datagrid</dc:subject><dc:subject>Flex</dc:subject><dc:subject>itemEditor</dc:subject><dc:subject>itemRenderer</dc:subject><dc:subject>line break</dc:subject><dc:subject>linebreak</dc:subject><dc:subject>parse</dc:subject><dc:subject>regex</dc:subject><dc:subject>regular expresion</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/11/26/flex-linebreaks-in-datagrid-itemrenderer-and-itemeditors/</guid>
		<description><![CDATA[This is a follow on to my previous blog entry:
http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/
Here I show how to deal with line breaks in itemRenderer and itemEditors instead of in a datagrid labelFunction.
(This is also a nice example of writing simple, separate itemRenderer and itemEditors.)
Here is the application code:

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; xmlns:local=&#34;*&#34;&#62;
&#160; &#160; &#60;mx:Array id=&#34;arr2&#34;&#62;
&#160; &#160; &#160; &#160; &#60;mx:Object [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow on to my previous blog entry:<br />
<a href="http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/">http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/</a></p>
<p>Here I show how to deal with line breaks in itemRenderer and itemEditors instead of in a datagrid labelFunction.<br />
(This is also a nice example of writing simple, separate itemRenderer and itemEditors.)</p>
<p>Here is the application code:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> xmlns:local=<span style="color: #ff0000;">&quot;*&quot;</span>&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Array</span> id=<span style="color: #ff0000;">&quot;arr2&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters <span style="color: #000099; font-weight: bold;">\n</span>Unicode character code <span style="color: #000099; font-weight: bold;">\n</span>Downloading the latest Adobe Labs version <span style="color: #000099; font-weight: bold;">\n</span>of Flex 3 SDK/Flex Builder 3 <span style="color: #000099; font-weight: bold;">\n</span>(codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly <span style="color: #000099; font-weight: bold;">\n</span>Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control<span style="color: #000099; font-weight: bold;">\n</span>Formatting data tips in a Slide<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters <span style="color: #000099; font-weight: bold;">\n</span>Unicode character code <span style="color: #000099; font-weight: bold;">\n</span>Downloading the latest Adobe Labs version <span style="color: #000099; font-weight: bold;">\n</span>of Flex 3 SDK/Flex Builder 3 <span style="color: #000099; font-weight: bold;">\n</span>(codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly <span style="color: #000099; font-weight: bold;">\n</span>Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control<span style="color: #000099; font-weight: bold;">\n</span>Formatting data tips in a Slide<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters <span style="color: #000099; font-weight: bold;">\n</span>Unicode character code <span style="color: #000099; font-weight: bold;">\n</span>Downloading the latest Adobe Labs version <span style="color: #000099; font-weight: bold;">\n</span>of Flex 3 SDK/Flex Builder 3 <span style="color: #000099; font-weight: bold;">\n</span>(codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly <span style="color: #000099; font-weight: bold;">\n</span>Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control<span style="color: #000099; font-weight: bold;">\n</span>Formatting data tips in a Slide<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;/mx:Array&gt;<br />
&nbsp; &nbsp; &lt;mx:ArrayCollection id=<span style="color: #ff0000;">&quot;arrColl2&quot;</span> source=<span style="color: #ff0000;">&quot;{arr2}&quot;</span> /&gt;&nbsp; &nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &lt;mx:DataGrid <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;250&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl2}&quot;</span> variableRowHeight=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> editable=<span style="color: #ff0000;">&quot;true&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headerText=<span style="color: #ff0000;">&quot;Name of the article in question&quot;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itemRenderer=<span style="color: #ff0000;">&quot;MyRenderer&quot;</span> dataField=<span style="color: #ff0000;">&quot;articleName&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itemEditor=<span style="color: #ff0000;">&quot;MyEditor&quot;</span> editable=<span style="color: #ff0000;">&quot;true&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; editorUsesEnterKey=<span style="color: #ff0000;">&quot;true&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn dataField=<span style="color: #ff0000;">&quot;data&quot;</span> headerText=<span style="color: #ff0000;">&quot;ID of the article&quot;</span> editable=<span style="color: #ff0000;">&quot;false&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:columns&gt;<br />
&nbsp; &nbsp; &lt;/mx:DataGrid&gt;<br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p>Here is the itemRenderer based on Text:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:<span style="color: #0066CC;">Text</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{txt}&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">implements</span>=<span style="color: #ff0000;">&quot;mx.controls.listClasses.IDropInListItemRenderer&quot;</span>&gt;<br />
&lt;mx:Script&gt;<br />
&nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">ListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">BaseListData</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _listData:DataGridListData;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">String</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span> = value;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> str:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>_listData.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> myPattern:RegExp = /\\n/g;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> newStr:<span style="color: #0066CC;">String</span>=str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>myPattern, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txt = newStr;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;&nbsp;&nbsp;override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> listData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:BaseListData<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _listData;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> listData<span style="color: #66cc66;">&#40;</span>value:BaseListData<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _listData = DataGridListData<span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&lt;/mx:Text&gt;&nbsp; <br />
&nbsp;</div>
<p>Here is the itemEditor based on TextArea:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:TextArea xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{txt}&quot;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">implements</span>=<span style="color: #ff0000;">&quot;mx.controls.listClasses.IDropInListItemRenderer&quot;</span>&gt;<br />
&lt;mx:Script&gt;<br />
&nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">ListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">dataGridClasses</span>.<span style="color: #006600;">DataGridListData</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">listClasses</span>.<span style="color: #006600;">BaseListData</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _listData:DataGridListData;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">String</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span> = value;&nbsp;&nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> str:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#91;</span>_listData.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> myPattern:RegExp = /\\n/g;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> newStr:<span style="color: #0066CC;">String</span>=str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>myPattern, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; txt = newStr;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;&nbsp;&nbsp;override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> listData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:BaseListData<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _listData;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> listData<span style="color: #66cc66;">&#40;</span>value:BaseListData<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _listData = DataGridListData<span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&lt;/mx:TextArea&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG_renderers/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG_renderers/srcview/__739stl_linebreaks_and_DG_renderers.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="500" height="550">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG_renderers/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG_renderers/app.swf" type="application/x-shockwave-flash" width="500" height="550" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/11/26/flex-linebreaks-in-datagrid-itemrenderer-and-itemeditors/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Flex linebreaks in the DataGrid</title>
		<link>http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/</link>
		<comments>http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 15:00:43 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category><dc:subject>datagrid</dc:subject><dc:subject>Flex</dc:subject><dc:subject>label function</dc:subject><dc:subject>labelFunction</dc:subject><dc:subject>line break</dc:subject><dc:subject>linebreak</dc:subject><dc:subject>parse</dc:subject><dc:subject>regex</dc:subject><dc:subject>regular expresion</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/</guid>
		<description><![CDATA[This is a follow up to my previous linebreak post.
This demonstrates how to deal with parsing linebreaks when they are in the text data for a datagrid.
You can either escape them in your source text data as shown in the previous post or you can use a labelFunction and some simple regular expression parsing to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow up to my previous <a href="http://blog.739saintlouis.com/2007/11/19/flex-linebreak-bug-workaround/">linebreak post</a>.</p>
<p>This demonstrates how to deal with parsing linebreaks when they are in the text data for a datagrid.<br />
You can either escape them in your source text data as shown in the previous post or you can use a labelFunction and some simple regular expression parsing to handle the escaping.</p>
<p>Here is the application code:</p>
<div class="ch_code_container" style="font-family: monospace;height:300px;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> format<span style="color: #66cc66;">&#40;</span>item:<span style="color: #0066CC;">Object</span>, column:DataGridColumn<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> str:<span style="color: #0066CC;">String</span>=item<span style="color: #66cc66;">&#91;</span>column.<span style="color: #006600;">dataField</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> myPattern:RegExp = /\\n/g;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> newStr:<span style="color: #0066CC;">String</span>=str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>myPattern, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> newStr;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Array</span> id=<span style="color: #ff0000;">&quot;arr1&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters <span style="color: #000099; font-weight: bold;">\n</span>Unicode character <span style="color: #000099; font-weight: bold;">\n</span>code&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly <span style="color: #000099; font-weight: bold;">\n</span>Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Formatting data tips in a Slider&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;7&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Downloading the latest Adobe Labs version of Flex 3 SDK/Flex Builder 3 (codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;6&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;/mx:Array&gt;<br />
&nbsp; &nbsp; &lt;mx:ArrayCollection id=<span style="color: #ff0000;">&quot;arrColl&quot;</span> source=<span style="color: #ff0000;">&quot;{arr1}&quot;</span> /&gt;&nbsp; &nbsp;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Array</span> id=<span style="color: #ff0000;">&quot;arr2&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Finding out a characters {&#8217;<span style="color: #000099; font-weight: bold;">\n</span>&#8216;}Unicode character code&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;15&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in an Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;14&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Setting an icon in a Button control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;13&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Installing the latest nightly {&#8217;<span style="color: #000099; font-weight: bold;">\n</span>&#8216;}Flex 3 SDK build into Flex Builder 3&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Detecting which button a user pressed to dismiss an Alert dialog&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;9&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Using the Alert control&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;8&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Formatting data tips in a Slider&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;7&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Object</span> articleName=<span style="color: #ff0000;">&quot;Downloading the latest Adobe Labs version of Flex 3 SDK/Flex Builder 3 (codename: Moxie)&quot;</span> <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;6&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;/mx:Array&gt;<br />
&nbsp; &nbsp; &lt;mx:ArrayCollection id=<span style="color: #ff0000;">&quot;arrColl2&quot;</span> source=<span style="color: #ff0000;">&quot;{arr2}&quot;</span> /&gt;&nbsp; &nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Text</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;this dg uses a labelFunction to manipulate the linebreaks&quot;</span>/&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:DataGrid id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> variableRowHeight=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;35%&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn labelFunction=<span style="color: #ff0000;">&quot;format&quot;</span> dataField=<span style="color: #ff0000;">&quot;articleName&quot;</span> headerText=<span style="color: #ff0000;">&quot;Name of the article in question&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn dataField=<span style="color: #ff0000;">&quot;data&quot;</span> headerText=<span style="color: #ff0000;">&quot;ID of the article&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:columns&gt;<br />
&nbsp; &nbsp; &lt;/mx:DataGrid&gt;&nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Text</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;this dg has the linebreaks modified in the source {&#8217;<span style="color: #000099; font-weight: bold;">\n</span>&#8216;}arraycollection using curly braces and single quotes.&quot;</span>/&gt;</p>
<p>&nbsp; &nbsp; &lt;mx:DataGrid dataProvider=<span style="color: #ff0000;">&quot;{arrColl2}&quot;</span> variableRowHeight=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;60%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;35%&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:columns&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn dataField=<span style="color: #ff0000;">&quot;articleName&quot;</span> headerText=<span style="color: #ff0000;">&quot;Name of the article in question&quot;</span>/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:DataGridColumn dataField=<span style="color: #ff0000;">&quot;data&quot;</span> headerText=<span style="color: #ff0000;">&quot;ID of the article&quot;</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:columns&gt;<br />
&nbsp; &nbsp; &lt;/mx:DataGrid&gt;<br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG/srcview/__739stl_linebreaks_and_DG.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="500" height="550">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks_and_DG/app.swf" type="application/x-shockwave-flash" width="500" height="550" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/11/22/flex-linebreaks-in-the-datagrid/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Flex linebreak bug workaround</title>
		<link>http://blog.739saintlouis.com/2007/11/19/flex-linebreak-bug-workaround/</link>
		<comments>http://blog.739saintlouis.com/2007/11/19/flex-linebreak-bug-workaround/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 15:00:00 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
		
	<category>Flex</category>
	<category>actionscript</category>
	<category>mxml</category><dc:subject>actionscript</dc:subject><dc:subject>bug</dc:subject><dc:subject>Flex</dc:subject><dc:subject>line break</dc:subject><dc:subject>linebreak</dc:subject><dc:subject>mxml</dc:subject><dc:subject>text</dc:subject>
		<guid isPermaLink="false">http://blog.739saintlouis.com/2007/11/19/flex-linebreak-bug-workaround/</guid>
		<description><![CDATA[I had a customer who was having problems with linebreaks in her Flex code.
I had used linebreaks before with no problem until I realized that she was setting text with linebreaks in mxml and not setting properties dynamically as I had done in all instances in teh past when dealing with linebreaks.
I search the Adobe [...]]]></description>
			<content:encoded><![CDATA[<p>I had a customer who was having problems with linebreaks in her Flex code.<br />
I had used linebreaks before with no problem until I realized that she was setting text with linebreaks in mxml and not setting properties dynamically as I had done in all instances in teh past when dealing with linebreaks.<br />
I search the Adobe public bugbase and found this bug:</p>
<p><a href="http://bugs.adobe.com/jira/browse/SDK-12649">http://bugs.adobe.com/jira/browse/SDK-12649</a></p>
<p>I thought I&#8217;d write a simple app to demonstrate the problem and workarounds.</p>
<p>Here is the source for the app:</p>
<div class="ch_code_container" style="font-family: monospace;height:100%;">
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;<br />
&lt;mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;mx:Label id=<span style="color: #ff0000;">&quot;ta1&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;75&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;This does not <span style="color: #000099; font-weight: bold;">\n</span>wrap&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;click to set via actionscript&quot;</span> click=<span style="color: #ff0000;">&quot;ta2.text=&#8217;Setting via actionscript and<span style="color: #000099; font-weight: bold;">\n</span>this does wrap&#8217;&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;mx:Label id=<span style="color: #ff0000;">&quot;ta2&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;75&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;250&quot;</span>/&gt;<br />
&nbsp; &nbsp; &lt;mx:Label id=<span style="color: #ff0000;">&quot;ta3&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;75&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Alternatively with this workaround,{&#8217;<span style="color: #000099; font-weight: bold;">\n</span>&#8216;}this wraps too&quot;</span>/&gt;<br />
&lt;/mx:Application&gt;<br />
&nbsp;</div>
<p><a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks/srcview">Browse the source of this example.</a><br />
<a href="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks/srcview/__739stl_linebreaks.zip">Download a zipfile containing the source to this sample.<br />
</a></p>
<p>
<object type="application/x-shockwave-flash" width="500" height="550">
<param name="movie" value="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks/app.swf" />
<embed src="http://blog.739saintlouis.com/wp-content/code/Flex2.0.1hf2/739stl_linebreaks/app.swf" type="application/x-shockwave-flash" width="500" height="550" >
</object>

</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.739saintlouis.com/2007/11/19/flex-linebreak-bug-workaround/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
