<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1245414118611676168</id><updated>2011-12-10T20:50:54.246-08:00</updated><category term='Printing'/><category term='Calculated measure'/><category term='Compiler error'/><category term='WebService'/><category term='Adobe India Evangelism Team'/><category term='Pivot'/><category term='Performance'/><category term='quick assist'/><category term='OLAPTimeDimension'/><category term='Print'/><category term='Auto generating columns'/><category term='DateChooser'/><category term='DataGrid'/><category term='DCD'/><category term='Sort'/><category term='Moxie'/><category term='selectableRange'/><category term='AdvancedDataGrid'/><category term='C++ DLL'/><category term='Summary'/><category term='OLAPDataGrid'/><category term='Charts'/><category term='ActiveX'/><category term='labelFunction'/><category term='keyword'/><category term='Grouping'/><category term='GroupingField'/><category term='Gumbo Beta'/><category term='Column Grouping'/><category term='Flex'/><category term='GroupingCollection'/><category term='coloring cells'/><category term='dataFunction'/><category term='HTTPService'/><category term='CF'/><category term='row'/><category term='Automation'/><category term='itemRenderers'/><category term='Drag drop'/><category term='memory leak'/><category term='Header customization'/><category term='Adobe'/><category term='VerifyError: Error #1030: Stack depth is unbalanced.'/><category term='ArrayCollection'/><category term='nested data'/><category term='Delegate'/><category term='String Aggregation'/><category term='OLAP'/><category term='ExternalInterface'/><category term='FlashBuilder'/><category term='PDF'/><category term='Custom Aggregation.'/><category term='sortFunction'/><category term='groupLabelFunction'/><category term='Unable to resolve a class for ResourceBundle'/><category term='ResourceBundle'/><category term='content assist'/><category term='FlashBuilder tips and tricks'/><category term='XML'/><category term='TileList'/><category term='OLAPCube'/><category term='extention point'/><category term='filter'/><category term='groupingFunction'/><category term='DataGridColumn'/><category term='PHP'/><category term='source'/><category term='backgroundColor'/><category term='FlexBuilder Pro'/><category term='styles'/><category term='360Flex'/><category term='Flat Data'/><category term='Ruby'/><category term='TreeView'/><category term='Tree'/><category term='datavisualization.swc'/><category term='CollectionChangeEvent'/><category term='IHierachicalCollectionView'/><category term='Multiple sets of visual children have been specified for this component.'/><category term='smart column width'/><category term='CallResponder'/><category term='HierarchicalData'/><category term='AdvancedDataGridColumn'/><category term='alternate row colors per column'/><category term='XMLList'/><category term='ColdFusion'/><category term='DevSummit'/><title type='text'>Pearls of Flex</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>68</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3026052841022731060</id><published>2011-05-07T04:53:00.000-07:00</published><updated>2011-07-11T05:10:16.762-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='quick assist'/><category scheme='http://www.blogger.com/atom/ns#' term='extention point'/><title type='text'>How to add custom Quick Assist options to FlashBuilder 4.5 ?</title><content type='html'>Adding custom quick assist options to FlashBuilder 4.5.1 is easy.
&lt;p&gt;&lt;a href="https://docs.google.com/leaf?id=0B3Esi7RAJbDWMGM3OGUwNzQtMzZlYS00YWYzLTg0MzAtNjFiZmE2Mzg0YjFm&amp;hl=en_US"&gt;Here&lt;/a&gt; is a sample plugin I created to show how this can be done. Copy this plugin into the dropins folder found under the "Adobe FlashBuilder 4.5" folder of the installation. In FB pressing Ctrl+1 inside a ActionScript class or script block of MXML file should bring up the "Override/Implment Methods" quick assist option as shown below.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-lNuHph8Wg0s/TcU1LvfvyHI/AAAAAAAAAgQ/rOA9B_Ya7Zo/s1600/OverrideImplementQA.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 126px;" src="http://1.bp.blogspot.com/-lNuHph8Wg0s/TcU1LvfvyHI/AAAAAAAAAgQ/rOA9B_Ya7Zo/s320/OverrideImplementQA.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5603943787176904818" /&gt;&lt;/a&gt;

&lt;p&gt;One needs to implement the "com.adobe.flexbuilder.as.editor.quickAssistProvider" extension point to add custom quick assist providers in a custom plugin. The extension point requires the IQuickAssistProvider interface to be implemented by a class and supply this as a "class" value to the extension point description.

&lt;p&gt;&lt;b&gt;Step by step instructions on how to do this:&lt;/b&gt;
&lt;p&gt;
&lt;p&gt;1. Create a new workspace and import the following plugins from FlashBuilder plugins folder. (These are the basic plugins which are required for the example. You may need to import more plugins based on the exact quick assist you want to implement.)
&lt;p&gt; 
&lt;p&gt;com.adobe.flash.codemodel.core
&lt;p&gt;com.adobe.flexbuilder.as.editor
&lt;p&gt;com.adobe.flexbuilder.codemodel
&lt;p&gt;com.adobe.flexbuilder.editorcore
&lt;p&gt;com.adobe.flexbuilder.editors.derived
&lt;p&gt;com.adobe.flexide.as.core
&lt;p&gt;com.adobe.flexide.editorcore
&lt;p&gt;
&lt;p&gt;2. Create a new plugin called say "com.adobe.flashbuilder.extras" 
&lt;p&gt;
&lt;p&gt;3. Add the extension point "com.adobe.flexbuilder.as.editor.quickAssistProvider"
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-tvcCxhZ7C3s/Thrln-zJE4I/AAAAAAAAA6c/KeJ3C59045Q/s1600/QuickAssistExt.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 77px;" src="http://1.bp.blogspot.com/-tvcCxhZ7C3s/Thrln-zJE4I/AAAAAAAAA6c/KeJ3C59045Q/s320/QuickAssistExt.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5628063159388017538" /&gt;&lt;/a&gt;
&lt;p&gt;4. Create a class implementing the interface IQuickAssistProvider by clicking the class link. Add the necessary code for the required functionality in the class following the example source given.
&lt;p&gt;The interface has only one method getProposals which needs to return a list of proposals that need to be displayed at the particular offset at which the user has invoked the quick assist. Using the information available in the IQuickAssistInvocationContext and other code model APIs the code can arrive at this list.

&lt;p&gt;5. Export the new plugin and place the jar in the dropins folder under the FB installation.

&lt;p&gt;&lt;b&gt;Caution :&lt;/b&gt; In case you find that quick assist functionality of FB stops working check the logs to see if the new plugin is causing any exceptions causing this.

&lt;p&gt;The example source is available &lt;a href="https://docs.google.com/leaf?id=0B3Esi7RAJbDWZTQzNTQyYTUtNDViNi00YmJhLTg2NDAtMWE2MjFlMDM0MTkz&amp;hl=en_US"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3026052841022731060?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3026052841022731060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3026052841022731060' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3026052841022731060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3026052841022731060'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2011/05/how-to-add-custom-quick-assist-options.html' title='How to add custom Quick Assist options to FlashBuilder 4.5 ?'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-lNuHph8Wg0s/TcU1LvfvyHI/AAAAAAAAAgQ/rOA9B_Ya7Zo/s72-c/OverrideImplementQA.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6588998515001651724</id><published>2011-04-30T03:14:00.000-07:00</published><updated>2011-04-30T03:16:28.978-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><title type='text'>"What is new in FlashBuilder 4.5" session at 360Flex video</title><content type='html'>Video of Adam's session on "What is new in FB 4.5" at 360Flex is available &lt;a href="http://zaa.tv/2011/04/360flex-denver-2011-whats-new-in-flash-builder-4-5/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6588998515001651724?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6588998515001651724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6588998515001651724' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6588998515001651724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6588998515001651724'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2011/04/what-is-new-in-flashbuilder-45-session.html' title='&quot;What is new in FlashBuilder 4.5&quot; session at 360Flex video'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1782245797541847753</id><published>2011-04-24T21:59:00.000-07:00</published><updated>2011-04-24T22:13:11.131-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder tips and tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='360Flex'/><title type='text'>FlashBuilder Tips and Tricks slides</title><content type='html'>A copy of the slides I showed in &lt;a href="www.360flex.com"&gt;360Flex&lt;/a&gt; is available &lt;a href="https://docs.google.com/leaf?id=0B3Esi7RAJbDWZmJjMGYwNDgtMDI5Yi00NTk2LTg5ODctNzU1OTFlMTY0YTlm&amp;hl=en"&gt;here&lt;/a&gt;. 
&lt;p&gt;
In the end there are few more slides which I didn't show as they are already available in &lt;a href="http://tv.adobe.com/watch/max-2010-develop/flash-builder-advanced-tips-and-techniques/"&gt;MAX 2010&lt;/a&gt; and &lt;a href="http://tv.adobe.com/watch/max-2009-develop/flash-builder-4-advanced-tips-and-tricks/"&gt;MAX 2009&lt;/a&gt; videos.
&lt;p&gt;
There is also an &lt;a href="http://www.adobe.com/devnet/flash-builder/articles/flashbuilder45-coding-enhancements.html"&gt;article&lt;/a&gt; which contains most of the information presented but not all !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1782245797541847753?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1782245797541847753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1782245797541847753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1782245797541847753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1782245797541847753'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2011/04/flashbuilder-tips-and-tricks-slides.html' title='FlashBuilder Tips and Tricks slides'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5068079537271911742</id><published>2011-04-13T10:01:00.000-07:00</published><updated>2011-04-24T19:08:26.369-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='dataFunction'/><category scheme='http://www.blogger.com/atom/ns#' term='sortFunction'/><category scheme='http://www.blogger.com/atom/ns#' term='labelFunction'/><category scheme='http://www.blogger.com/atom/ns#' term='quick assist'/><title type='text'>Use QuickAssist in FlashBuilder 4.5 to create labelFunction,iconFunction,dataFunction etc..</title><content type='html'>One of the cool features of FlashBuilder 4.5 is support for creating labelFunction, sortFunction, dataFunction, iconFunction (basically any Function property of Flex SDK MXML components) using Quick Assist. 

&lt;p&gt;
Steps :
&lt;p&gt;
1. Go to the component tag and use content assist to enter the *Function attribute.
&lt;p&gt;
Ex: &amp;lt;s:List labelFunction="" 
&lt;p&gt;
2. Type the function name.
&lt;p&gt;
Ex: &amp;lt;s:List labelFunction="myLabelFunc" 
&lt;p&gt;
3. With the cursor still between the quotes hit Ctrl+1 (or Cmd+1 on Mac).
&lt;p&gt;
4. You should something similar to the following

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-YGg19aeVm8c/TaXgAJuApxI/AAAAAAAAAgA/59JxlE1UnZI/s1600/LabelFunctionQuickAssist.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 61px;" src="http://4.bp.blogspot.com/-YGg19aeVm8c/TaXgAJuApxI/AAAAAAAAAgA/59JxlE1UnZI/s320/LabelFunctionQuickAssist.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5595124405291230994" /&gt;&lt;/a&gt;
&lt;p&gt;
5. Select it and hit enter. FB should create the function with proper signature and go into linked mode.
&lt;p&gt;
For adventurous developers: 
&lt;p&gt;
If you find the "Create function ..." option missing any particular Function property for any component you can edit the componentDescriptor.xml file (which can be found under the Adobe Flash Builder 4.5\eclipse\plugins\com.adobe.flexbuilder.mxml.editor_4.5.0.xxxxx directory) and add the entry yourself and fix it !
&lt;p&gt;
Caution : Save the original xml file in case you end up spoiling it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5068079537271911742?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5068079537271911742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5068079537271911742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5068079537271911742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5068079537271911742'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2011/04/use-quickassit-in-flashbuilder-45-to.html' title='Use QuickAssist in FlashBuilder 4.5 to create labelFunction,iconFunction,dataFunction etc..'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-YGg19aeVm8c/TaXgAJuApxI/AAAAAAAAAgA/59JxlE1UnZI/s72-c/LabelFunctionQuickAssist.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-4517212638555541912</id><published>2011-04-13T08:58:00.000-07:00</published><updated>2011-04-13T09:45:20.653-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='keyword'/><category scheme='http://www.blogger.com/atom/ns#' term='content assist'/><title type='text'>How to use code templates to enter keywords without mistakes ?</title><content type='html'>After my "FlashBuilder tips and tricks" session at 360Flex where I erred while entering "implements" keyword I thought through it and came up with this.

Add the following code template with any name it suits you. I used "kw".
&lt;p&gt;

&lt;code&gt;
${keyword:values(public, protected, private, function, implements, var, try, catch, class, interface, package)} ${cursor}
&lt;/code&gt;

&lt;p&gt;
Now where ever I need to enter a keyword I just need to type "kw" and hit Ctrl+Space to get a popup showing all the keywords. (Note: Modify the list of keywords to suit your need)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-4517212638555541912?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/4517212638555541912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=4517212638555541912' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4517212638555541912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4517212638555541912'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2011/04/how-to-use-code-templates-to-enter.html' title='How to use code templates to enter keywords without mistakes ?'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-852671351025818257</id><published>2010-01-20T22:30:00.000-08:00</published><updated>2010-01-20T22:33:12.991-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>New GroupingCollection2 class with improved perforamnce</title><content type='html'>Rather than repeat the same thing : Sameer talks about the new &lt;a href="http://techrays.wordpress.com/2009/11/04/groupingcollection-with-improved-performance/"&gt;GroupingCollection&lt;/a&gt; to in data visualization swc of Flex.

&lt;p&gt;
Give it a try !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-852671351025818257?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/852671351025818257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=852671351025818257' title='82 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/852671351025818257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/852671351025818257'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2010/01/new-groupingcollection2-class-with.html' title='New GroupingCollection2 class with improved perforamnce'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>82</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5632002667444170396</id><published>2009-12-24T03:46:00.000-08:00</published><updated>2009-12-24T04:05:37.479-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='memory leak'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>4 items to check if a Flex 4 Application is leaking memory !</title><content type='html'>I have been working with Flash Builder profiler for past few months. After looking at few applications and memory leaks in them I came up with following 4 items which can cause a Flex application to leak memory.
&lt;p&gt;
If you don't like to read lot of text the gist is to &lt;b&gt;use weak references where ever possible&lt;/b&gt;. 
&lt;p&gt;
&lt;p&gt;
1. &lt;a href="http://www.adobe.com/livedocs/flex/3/langref/flash/events/EventDispatcher.html#addEventListener()"&gt;addEventListener&lt;/a&gt; is being called with the default value of false for its useWeakReference flag.

&lt;p&gt;2. bindProperty and bindSetter methods of &lt;a href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/mx/binding/utils/BindingUtils.html"&gt;BindingUtils&lt;/a&gt; are called with default value of false for its useWeakReference flag.

&lt;p&gt; Please note: I don't know what is the equivalent thing in Flex 3.
&lt;p&gt;
3. &lt;a href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/mx/binding/utils/ChangeWatcher.html#watch()"&gt;ChangeWatcher.watch&lt;/a&gt; method is being called with default value of false for its useWeakReference flag.
&lt;p&gt; Please note: I don't know what is the equivalent thing in Flex 3.
&lt;p&gt;
4. &lt;a href="http://livedocs.adobe.com/flex/3/langref/flash/utils/Dictionary.html"&gt;Dictionaries&lt;/a&gt; are being used with weakKeys flag in the constructor set to false.
&lt;p&gt;&lt;p&gt;
Items 3 and 4 can cause some hidden links to be formed and memory to leak. More on that soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5632002667444170396?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5632002667444170396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5632002667444170396' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5632002667444170396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5632002667444170396'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/12/4-items-to-check-if-flex-4-application.html' title='4 items to check if a Flex 4 Application is leaking memory !'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1681314801143548319</id><published>2009-11-13T06:00:00.000-08:00</published><updated>2009-11-13T06:06:14.454-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DevSummit'/><category scheme='http://www.blogger.com/atom/ns#' term='Adobe'/><title type='text'>Adobe DevSummit 2009 in Chennai and Hyderabad (India)</title><content type='html'>Adobe is conducting a &lt;a href="http://endtoend.in/apps/forms/adobe/DevSummitNovDec09/home.html"&gt;developer summit&lt;/a&gt; in Chennai and Hyderabad on Nov 24th and Dec 1st 2009. If you are a RIA developer and want to know more about features in upcoming release of Flash Builder 4 and also on how to connect to LiveCycle DS or Blaze DS be there !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1681314801143548319?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1681314801143548319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1681314801143548319' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1681314801143548319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1681314801143548319'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/11/adobe-devsummit-2009-in-chennai-and.html' title='Adobe DevSummit 2009 in Chennai and Hyderabad (India)'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-983895959363820065</id><published>2009-10-11T22:06:00.000-07:00</published><updated>2009-10-11T22:11:03.729-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='DCD'/><title type='text'>Ruby on Rails extension for FlashBuilder4</title><content type='html'>The DCD (Data Centric Development) feature of Flash Builder 4 is an extensible feature. What I mean by that is that developers can add a new plugin to FB which implements certain extension points available in FB and add support for any back end of their choice. Once added all the DCD features would work with the back end similar to other supported back ends like PHP, CF etc.

&lt;p&gt;Gaurav has worked on a plugin to add support for &lt;a href="http://dcdror.riaforge.org/"&gt;Ruby&lt;/a&gt;.
&lt;p&gt; Give it a try !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-983895959363820065?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/983895959363820065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=983895959363820065' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/983895959363820065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/983895959363820065'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/10/ruby-on-rails-extension-for.html' title='Ruby on Rails extension for FlashBuilder4'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2923038230150607358</id><published>2009-08-13T01:51:00.000-07:00</published><updated>2009-08-13T01:57:57.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Adobe India Evangelism Team'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Adobe India Evangelism Team launches a challenge in Flex</title><content type='html'>&lt;a target="_blank" href="http://flashahead.adobe.com/challenges"&gt;&lt;div align="center"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 150px; height: 190px;" src="http://1.bp.blogspot.com/_sh8W7P3dJgY/SoPUU7W0SJI/AAAAAAAAACc/UB9N6FEp15U/s400/SreenivasR.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5369368636751628434"
alt="hackrchallenges badge" /&gt;&lt;/div&gt;&lt;/a&gt;
&lt;p&gt;

You can also own a badge like this one ! &lt;a href="http://flashahead.adobe.com/challenges"&gt;Try it&lt;/a&gt; !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2923038230150607358?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2923038230150607358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2923038230150607358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2923038230150607358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2923038230150607358'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/08/adobe-india-evangelism-team-launches.html' title='Adobe India Evangelism Team launches a challenge in Flex'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_sh8W7P3dJgY/SoPUU7W0SJI/AAAAAAAAACc/UB9N6FEp15U/s72-c/SreenivasR.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2115671403425627315</id><published>2009-06-19T19:01:00.000-07:00</published><updated>2009-06-19T19:12:52.868-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OLAPDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Tweaking OLAPCell and OLAPDataGrid to display custom formatted values</title><content type='html'>Displaying custom formatted data in OLAPDataGrid is a bit tricky because OLAPDataGrid doesn't use the OLAPCell.formattedValue at all due to a bug in its implementation.

&lt;p&gt;
However the tweaks I am going to mention are simple and can be used to get this to work. After the tweaks don't forget to build the datavisualization.swc using the steps I have described in one of the earlier posts.

&lt;p&gt;
Modifing OLAPCell.as file : Modify the constructor to set a formatted value into the _formattedValue property

&lt;p&gt;
public function OLAPCell(value:Number, formattedValue:String=null)
&lt;p&gt;
{
&lt;p&gt;
&lt;p&gt;
_value = value;
&lt;p&gt;
_formattedValue = insert any custom formatting logic using value ;
&lt;p&gt;
}
&lt;p&gt;
&lt;p&gt;

Modify OLAPDataGrid.as : Somewhere around line 769 we can find the following line

&lt;p&gt;
label = cell &amp;&amp; !isNaN(cell.value) ? String(cell.value) : defaultCellString;

&lt;p&gt;&lt;p&gt;
Modify this to read as follows
&lt;p&gt;
label = cell &amp;&amp; !isNaN(cell.value) ? String(cell.formattedValue) : defaultCellString;
&lt;p&gt;&lt;p&gt;

Build the swc and use it in your app to get custom formatting. Of-course some more tweaking it required to make this generic and supply a Flex formatter directly to OLAPDataGrid. I am sure it can be easily figured out !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2115671403425627315?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2115671403425627315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2115671403425627315' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2115671403425627315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2115671403425627315'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/06/tweaking-olapcell-and-olapdatagrid-to.html' title='Tweaking OLAPCell and OLAPDataGrid to display custom formatted values'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-328205419788862798</id><published>2009-06-08T20:44:00.000-07:00</published><updated>2009-06-08T20:51:38.543-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='CallResponder'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>CallResponders explained..</title><content type='html'>Here is some explanation about CallResponders by &lt;a href="http://labs.adobe.com/technologies/flash/videos/flashcamp/lane/"&gt;Tom Lane&lt;/a&gt;. I thought this would be useful to many developers who want to understand more about them so that it becomes easy to work with them.

&lt;p&gt;
"Let me take a shot at explaining asynchronous calls. Most PHP developers are used to calling functions in one way only: synchronously. In ActionScript a sychronous function call looks like this:

&lt;p&gt;
var stuff = getStuff();
 
&lt;p&gt;Pretty straightforward. It's how you expect functions to work: you call them, and then immediately on line #2 of this example you have a value in the stuff variable to work with.
 
&lt;p&gt;But when it comes to calling remote functions on services sitting on a server somewhere, Flex calls them asynchronously. This is so that the Flex client can continue working while the request is pending. An aync call looks more like this (at least, the first part):
 
&lt;p&gt;responder.token = getStuffFromService();
 
&lt;p&gt;&lt;p&gt;What this means is, "stuff" does not come back right away as the result of the function. Instead, what it returns is a kind of ticket. Sort of like ordering some food from a lunch counter and getting a receipt with a number on it. You don't get your food right away. Instead, you go hang out or do some other stuff while your order is pending, and then your number is called when it's ready. And then you "respond" to your number.
 
&lt;p&gt;Well, that's what a CallResponder is. When you "place your order", you hook up a CallResponder to it. When your order is ready (data comes back from the service call), the responder kicks into action. It fires a result event (or a fault if something went wrong), and it updates its bindable lastResult property.
 
&lt;p&gt;So, if you want to work with data from an async call, you can't simply do it on line #2 of the above snippet. You have to wait until the CallResponder for that call gets its result. If you create a databinding to lastResult, that will automatically update when the result is ready. But since you want to run some script on the result, you have to trigger that script from the CallResponder's result event handler.

&lt;p&gt;Hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-328205419788862798?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/328205419788862798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=328205419788862798' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/328205419788862798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/328205419788862798'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/06/callresponders-explained.html' title='CallResponders explained..'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6890378855716368673</id><published>2009-06-06T20:08:00.000-07:00</published><updated>2009-06-06T20:35:55.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OLAPDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='coloring cells'/><title type='text'>Showing different icons in each cell of OLAPDataGrid based on the cell value</title><content type='html'>I have been getting few queries on how to show different icons based on the cell value in a OLAPDataGrid.

&lt;p&gt;
Here is a screen shot of how it looks:
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_sh8W7P3dJgY/SiszVSU1yKI/AAAAAAAAACU/1IuA8WuSqtY/s1600-h/OLAPColors.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 219px;" src="http://4.bp.blogspot.com/_sh8W7P3dJgY/SiszVSU1yKI/AAAAAAAAACU/1IuA8WuSqtY/s400/OLAPColors.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5344421823594743970" /&gt;&lt;/a&gt;
&lt;p&gt;

Here are the &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPColorTest.zip"&gt;source&lt;/a&gt; files.

&lt;p&gt;
The technique is simple. Create a custom itemRenderer which can display a icon and text or anything to suite your needs. Make sure it implements the &lt;a href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/IDropInListItemRenderer.html"&gt;IDropInListItemRenderer&lt;/a&gt; interface. In the setter of listData add the logic to change the icon based on the value. Set this as itemRenderer of the OLAPDataGrid.

&lt;p&gt;The sample shows this using a renderer derived from Canvas with a image control and embedded image files. You can use other light weight techniques like coloring a sprite and using UIComponent as base. If you are adventurous you can try tweaking or deriving from OLAPDataGridItemRenderer itself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6890378855716368673?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6890378855716368673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6890378855716368673' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6890378855716368673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6890378855716368673'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/06/showing-different-icons-in-each-cell-of.html' title='Showing different icons in each cell of OLAPDataGrid based on the cell value'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_sh8W7P3dJgY/SiszVSU1yKI/AAAAAAAAACU/1IuA8WuSqtY/s72-c/OLAPColors.PNG' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-504606365226631161</id><published>2009-06-06T18:46:00.000-07:00</published><updated>2009-06-08T20:36:22.431-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTPService'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><category scheme='http://www.blogger.com/atom/ns#' term='CF'/><category scheme='http://www.blogger.com/atom/ns#' term='WebService'/><title type='text'>Blogs on Data Centric Development workflows in FlashBuilder 4 for PHP, HTTPService, ColdFusion and WebService</title><content type='html'>Here are some great blogs on how to use DCD feature in FlashBuilder 4:

&lt;p&gt;
&lt;a href="http://www.geekzguru.net/howto-connect-a-flex-application-to-database-for-php-developers/"&gt;Howto: Connect a flex application to database (for PHP developers)&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://www.geekzguru.net/howto-use-createitem-method-of-the-generated-sample-php-file/"&gt;Howto: Use createItem method of the generated sample PHP file&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://www.geekzguru.net/howto-use-the-update-and-delete-methods-of-the-generated-sample-code/"&gt;Howto: Use the update and delete methods of the generated sample code&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://www.geekzguru.net/howto-enable-automatic-paging-support-for-any-server-technology/"&gt;Howto: Enable Automatic Paging in Flex Applications for Any Kind of Service&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://sujitreddyg.wordpress.com/flash-builder-4/"&gt;A list of many articles on Sujit's blog&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://balajisridhar.wordpress.com/2009/06/06/flash-builder-4-makes-a-new-marriage-proposal-between-flex-and-java/"&gt;BlazeDS support&lt;/a&gt;
&lt;p&gt;&lt;p&gt;
&lt;a href="http://srinivasannam.wordpress.com/2009/06/03/using-webservice-dcd/"&gt;Using web-services with DCD workflow&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-504606365226631161?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/504606365226631161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=504606365226631161' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/504606365226631161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/504606365226631161'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/06/blogs-on-data-centric-development.html' title='Blogs on Data Centric Development workflows in FlashBuilder 4 for PHP, HTTPService, ColdFusion and WebService'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7792314775085836440</id><published>2009-06-01T04:13:00.000-07:00</published><updated>2009-06-01T04:26:11.153-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlashBuilder'/><category scheme='http://www.blogger.com/atom/ns#' term='FlexBuilder Pro'/><category scheme='http://www.blogger.com/atom/ns#' term='Gumbo Beta'/><title type='text'>FlashBuilder (FlexBuilder renamed) 4 Beta is out</title><content type='html'>FlexBuilder has been renamed to FlashBuilder and version 4.0 Beta is out.

&lt;p&gt;
Rather than say the same thing over and over...here are the links which give detailed information:

&lt;p&gt;
&lt;a href="http://labs.adobe.com/technologies/flashbuilder4/"&gt;The Beta site&lt;/a&gt;
&lt;p&gt;
&lt;a href="http://srinivasannam.wordpress.com/2009/06/01/introduction_to_dc/"&gt;Srinivas Annam talking about Data Centric Development (DCD) &lt;/a&gt;
&lt;p&gt;
&lt;a href="http://exploringflex.wordpress.com/2009/06/01/flash-builder-4-data-centric-development-dcd-introduction/"&gt;How to use DCD work flows explained using flow charts&lt;/a&gt;

&lt;p&gt;
&lt;a href="http://sujitreddyg.wordpress.com/2009/06/01/building-flex-application-for-blazeds-remoting-service-using-flash-builder-4/"&gt;Sujit explains DCD workflows with BlazeDS&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7792314775085836440?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7792314775085836440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7792314775085836440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7792314775085836440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7792314775085836440'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/06/flashbuilder-flexbuilder-renamed-4-beta.html' title='FlashBuilder (FlexBuilder renamed) 4 Beta is out'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-256778880192697573</id><published>2009-05-13T03:56:00.000-07:00</published><updated>2009-05-13T04:00:20.064-07:00</updated><title type='text'>I am busy !</title><content type='html'>Hi All,

&lt;p&gt;
I have been busy at work for few months now and will continue to be so for some more time. That is the reason I have not been able to respond to mails/comments on my posts. I know some of them might have been very urgent issues but due to my own work deadlines I have not been able to respond to them.

&lt;p&gt;
Will try to address them as and when I get time.

&lt;p&gt;
&lt;b&gt;Thanks for your patience&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-256778880192697573?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/256778880192697573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=256778880192697573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/256778880192697573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/256778880192697573'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/05/i-am-busy.html' title='I am busy !'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-24922531048497476</id><published>2009-03-05T21:42:00.000-08:00</published><updated>2009-03-05T21:53:12.522-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String Aggregation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Flex OLAP aggregating strings.</title><content type='html'>I recently got many queries about support for String aggregation in Flex OLAP. The current implementation available out of the box doesn't support this.

&lt;p&gt;
&lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPStringAgg.zip"&gt;Here&lt;/a&gt; are the changes to source files required to support this. The files need to be unzipped into the fbpro directory and the datavisulization.swc needs to be build using the steps mentioned &lt;a href="http://flexpearls.blogspot.com/2009/01/how-to-build-datavisualizationswc-from.html"&gt;here&lt;/a&gt;.

&lt;p&gt;
The result would look something like this.

&lt;a href="http://2.bp.blogspot.com/_sh8W7P3dJgY/SbC438AwNFI/AAAAAAAAACM/ziFSGX2l8k4/s1600-h/OLAPString.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 115px;" src="http://2.bp.blogspot.com/_sh8W7P3dJgY/SbC438AwNFI/AAAAAAAAACM/ziFSGX2l8k4/s400/OLAPString.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5309947231811417170" /&gt;&lt;/a&gt;

&lt;p&gt;
The sample project has a StringAggreator implementation which can be used as a starting point to build your own logic into the StringAggregator. The sample one appends the strings to each other.

&lt;p&gt;
&lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPStringTest.zip"&gt;Here is the sample project&lt;/a&gt;.

&lt;p&gt;
Of-course I might have missed something while testing. So let me know if you find any bugs !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-24922531048497476?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/24922531048497476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=24922531048497476' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/24922531048497476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/24922531048497476'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/03/flex-olap-aggregating-strings.html' title='Flex OLAP aggregating strings.'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_sh8W7P3dJgY/SbC438AwNFI/AAAAAAAAACM/ziFSGX2l8k4/s72-c/OLAPString.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5455285254553515663</id><published>2009-01-19T20:59:00.000-08:00</published><updated>2009-01-19T21:30:00.783-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datavisualization.swc'/><category scheme='http://www.blogger.com/atom/ns#' term='source'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>How to build datavisualization.swc from the source ?</title><content type='html'>Here are steps to build datavisualization.swc from the source that gets unzipped into a fbpro directory in FlexBuilder when a valid license is provided. 
&lt;p&gt;
&lt;b&gt;Setup&lt;/b&gt;
&lt;p&gt;
1. &lt;a href="http://ant.apache.org/"&gt;Download ant1.7.0&lt;/a&gt;.
&lt;p&gt;2. &lt;a href="http://java.sun.com"&gt;Download a version of jdk 1.6&lt;/a&gt;. 
&lt;p&gt;3. &lt;a href="http://www.cygwin.com/mirrors.html"&gt;Download cygwin&lt;/a&gt;, an open source unix shell for Windows. 
&lt;p&gt;4. Set environment variables. Go to Control Panels &gt; System &gt; Advanced &gt; Environment Variables 
&lt;p&gt;• Set JAVA_HOME to the path to the jdk directory. Add path of ant1.7 to PATH. For example, C:\ant1.7.0\bin (you will already have a PATH, multiple entries are separated by semicolons) 
&lt;p&gt;• Add path of cygwin to PATH. For example, C:\cygwin\bin 

&lt;p&gt;
&lt;b&gt;Steps:&lt;/b&gt;
&lt;p&gt;1. Add files build.properties and build.xml(attached) to location of datavisualization directory. For example,  C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects. 
&lt;p&gt;2. Add the flex builder license to build.xml file (location:  C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects\build.xml) . Replace &lt;enter license&gt; by license key.
&lt;p&gt;3. Unzip inside_ datavisualization.zip. The build.xml and build.properties files should be copied inside datavisualization folder.For example, C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects\datavisualization. 
&lt;p&gt;4. Make changes regarding location of sdk and output swcs to files build.properties and datavisualization\build.properties. 
&lt;p&gt;5. At the cygwin prompt, go to the datavisualization. For example C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects\ datavisualization. 
&lt;p&gt;6. Run ant main to build datavisualisation.swc and datavisualization_rb.swc  for en_US .
&lt;p&gt;7. Run ant main_with_ja_JP to build datavisualisation.swc and datavisualization_rb.swc  for en_US and ja_JP.
&lt;p&gt;
&lt;b&gt;Note: Place the datavisualization.swc at sdk\frameworks\libs  and  datavisualization_rb.swc  at sdk\frameworks\locale.&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5455285254553515663?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5455285254553515663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5455285254553515663' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5455285254553515663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5455285254553515663'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2009/01/how-to-build-datavisualizationswc-from.html' title='How to build datavisualization.swc from the source ?'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1675539627124309153</id><published>2008-06-10T03:40:00.000-07:00</published><updated>2008-06-10T03:48:18.569-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom Aggregation.'/><category scheme='http://www.blogger.com/atom/ns#' term='Calculated measure'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>CalculatedMeasures in Flex OLAP</title><content type='html'>I wrote a small sample which shows how a Custom Aggregator can be written and used to simulate a Calculated measure in Flex OLAP. Of-course, this solution may not work for all requirements but can be used atleast in some scenarios.

The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/CalculatedMeasure.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1675539627124309153?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1675539627124309153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1675539627124309153' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1675539627124309153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1675539627124309153'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/06/calculatedmeasures-in-flex-olap.html' title='CalculatedMeasures in Flex OLAP'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5812728370168171427</id><published>2008-06-01T01:57:00.000-07:00</published><updated>2008-06-01T21:38:12.161-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Here is a GroupingCollection with good performance !</title><content type='html'>I created a new GroupingCollection2 (by tweaking the default implemenation) which has better performance compared to the GroupingCollection. Please find the &lt;a href="http://sreenivas.ramaswamy.googlepages.com/grouping.swc"&gt;swc&lt;/a&gt; here.

&lt;p&gt;Replace the GroupingCollection instance in any application with GroupingCollection2 and check the performance. When I tested it with 8K records with 4 grouping fields it was able to group in 5 seconds which seems to be good (in comparsion). 

&lt;p&gt;Please note this has not gone through extensive testing. I would be glad to fix any bugs found.

&lt;p&gt;If you are one of those who doesn't have patience to build and test an app, &lt;a href="http://sreenivas.ramaswamy.googlepages.com/improveGrouping.swf"&gt;here&lt;/a&gt; is the one I built. Here is the &lt;a href="http://sreenivas.ramaswamy.googlepages.com/improveGrouping.mxml"&gt;source&lt;/a&gt;.

&lt;p&gt;If you think it is worth your time drop a note about your findings !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5812728370168171427?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5812728370168171427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5812728370168171427' title='78 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5812728370168171427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5812728370168171427'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/06/groupingcollection-with-some-better.html' title='Here is a GroupingCollection with good performance !'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>78</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5544582562666806347</id><published>2008-05-28T23:07:00.000-07:00</published><updated>2008-05-29T06:24:29.467-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='XMLList'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>Grouping XML data using GroupingCollection</title><content type='html'>I was under the impression this doesn't require any sample as it should be very easy to write one. But frequent questions on the forums have resulted in this post.

&lt;p&gt;There is not much to describe so :

&lt;p&gt;
&lt;pre&gt;
&amp;lt;mx:XML id="inputData" &amp;gt;
 &amp;lt;Tulokset&amp;gt;
 &amp;lt;Tulos id="xxx" group="xx" /&amp;gt;
 &amp;lt;Tulos id="xxx" group="xx" /&amp;gt;
 &amp;lt;Tulos id="xxx" group="xx" /&amp;gt;
 &amp;lt;/Tulokset&amp;gt;
&amp;lt;/mx:XML&amp;gt; 
 
&amp;lt;mx:AdvancedDataGrid creationComplete="gc.refresh()"&amp;gt;
 &amp;lt;mx:dataProvider&amp;gt;
  &amp;lt;mx:GroupingCollection source="{inputData.Tulos}" id="gc"&amp;gt;
   &amp;lt;mx:Grouping&amp;gt;
    &amp;lt;mx:GroupingField name="@group" /&amp;gt;
   &amp;lt;/mx:Grouping&amp;gt;
  &amp;lt;/mx:GroupingCollection&amp;gt;
 &amp;lt;/mx:dataProvider&amp;gt;
 &amp;lt;mx:columns&amp;gt;
  &amp;lt;mx:AdvancedDataGridColumn dataField="@id" /&amp;gt;
 &amp;lt;/mx:columns&amp;gt;
&amp;lt;/mx:AdvancedDataGrid&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/groupXML.mxml"&gt;here&lt;/a&gt;.

&lt;p&gt;
&lt;p&gt;
&lt;b&gt;Update:&lt;/b&gt; The below example shows how to use grouping when the data is in child nodes instead of attributes. This is a bit tricky because &lt;a href="http://livedocs.adobe.com/flex/3/langref/mx/collections/GroupingCollection.html"&gt;GroupingCollection&lt;/a&gt; is derived from &lt;a href="http://livedocs.adobe.com/flex/3/langref/mx/collections/HierarchicalData.html"&gt;HierarchicalData&lt;/a&gt; which treats child nodes as children by default. This leads to problems when we try to display the data after grouping. The trick is to make use of the &lt;a href="http://livedocs.adobe.com/flex/3/langref/mx/collections/HierarchicalData.html#childrenField"&gt;childrenField&lt;/a&gt; property and point it to something like "undefined".

&lt;pre&gt;
&amp;lt;mx:XML id="inputData" &amp;gt;
 &amp;lt;Tulokset&amp;gt;
  &amp;lt;Tulos&amp;gt;
     &amp;lt;id&amp;gt;xx1&amp;lt;/id&amp;gt;
     &amp;lt;group&amp;gt;xxx&amp;lt;/group&amp;gt;
  &amp;lt;/Tulos&amp;gt;
  &amp;lt;Tulos&amp;gt;
     &amp;lt;id&amp;gt;xx2&amp;lt;/id&amp;gt;
     &amp;lt;group&amp;gt;xxx&amp;lt;/group&amp;gt;
  &amp;lt;/Tulos&amp;gt;
  &amp;lt;Tulos&amp;gt;
     &amp;lt;id&amp;gt;xx3&amp;lt;/id&amp;gt;
     &amp;lt;group&amp;gt;xxx&amp;lt;/group&amp;gt;
  &amp;lt;/Tulos&amp;gt;
 &amp;lt;/Tulokset&amp;gt;
&amp;lt;/mx:XML&amp;gt; 
 
&amp;lt;mx:AdvancedDataGrid creationComplete="gc.refresh()"&amp;gt;
 &amp;lt;mx:dataProvider&amp;gt;
  &amp;lt;mx:GroupingCollection source="{inputData.Tulos}" id="gc" childrenField="undefined"&amp;gt;
   &amp;lt;mx:Grouping&amp;gt;
    &amp;lt;mx:GroupingField name="group"  /&amp;gt;
   &amp;lt;/mx:Grouping&amp;gt;
  &amp;lt;/mx:GroupingCollection&amp;gt;
 &amp;lt;/mx:dataProvider&amp;gt;
 &amp;lt;mx:columns&amp;gt;
  &amp;lt;mx:AdvancedDataGridColumn dataField="id" /&amp;gt;
 &amp;lt;/mx:columns&amp;gt;
&amp;lt;/mx:AdvancedDataGrid&amp;gt;

&lt;/pre&gt;

&lt;p&gt;The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/groupXML2.mxml"&gt;here&lt;/a&gt;.

&lt;p&gt;Please note that childrenField is also helpful when we are trying to display XML data with data and children as child nodes. Use it to point to the proper node name which contains the children. In the following example we need to set childrenField="details" to work properly.

&lt;pre&gt;

&amp;lt;mx:XML id="special"&amp;gt;
&amp;lt;rows&amp;gt;
&amp;lt;row&amp;gt;
  &amp;lt;name&amp;gt;A&amp;lt;/name&amp;gt;
  &amp;lt;fund&amp;gt;100&amp;lt;/fund&amp;gt;
  &amp;lt;details&amp;gt;
   &amp;lt;row&amp;gt;
   &amp;lt;name&amp;gt;a&amp;lt;/name&amp;gt;
   &amp;lt;fund&amp;gt;20&amp;lt;/fund&amp;gt;
   &amp;lt;/row&amp;gt;
   &amp;lt;row&amp;gt;
   &amp;lt;name&amp;gt;b&amp;lt;/name&amp;gt;
   &amp;lt;fund&amp;gt;80&amp;lt;/fund&amp;gt;
   &amp;lt;/row&amp;gt;
  &amp;lt;/details&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;row&amp;gt;
  &amp;lt;name&amp;gt;C&amp;lt;/name&amp;gt;
  &amp;lt;fund&amp;gt;200&amp;lt;/fund&amp;gt;
  &amp;lt;details&amp;gt;
   &amp;lt;row&amp;gt;
   &amp;lt;name&amp;gt;a&amp;lt;/name&amp;gt;
   &amp;lt;fund&amp;gt;80&amp;lt;/fund&amp;gt;
   &amp;lt;/row&amp;gt;
   &amp;lt;row&amp;gt;
   &amp;lt;name&amp;gt;b&amp;lt;/name&amp;gt;
   &amp;lt;fund&amp;gt;80&amp;lt;/fund&amp;gt;
   &amp;lt;/row&amp;gt;
   &amp;lt;row&amp;gt;
   &amp;lt;name&amp;gt;c&amp;lt;/name&amp;gt;
   &amp;lt;fund&amp;gt;40&amp;lt;/fund&amp;gt;
   &amp;lt;/row&amp;gt;
  &amp;lt;/details&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/rows&amp;gt; 
&amp;lt;/mx:XML&amp;gt;

&amp;lt;mx:AdvancedDataGrid &amp;gt;
   &amp;lt;mx:dataProvider&amp;gt;
       &amp;lt;mx:HierarchicalData source="{special.row}" childrenField="details" &amp;gt;
       &amp;lt;/mx:HierarchicalData&amp;gt;
   &amp;lt;/mx:dataProvider&amp;gt;
 &amp;lt;mx:columns&amp;gt;
  &amp;lt;mx:AdvancedDataGridColumn dataField="name" /&amp;gt;
  &amp;lt;mx:AdvancedDataGridColumn dataField="fund" /&amp;gt;
 &amp;lt;/mx:columns&amp;gt;
&amp;lt;/mx:AdvancedDataGrid&amp;gt;

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5544582562666806347?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5544582562666806347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5544582562666806347' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5544582562666806347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5544582562666806347'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/05/grouping-xml-data-using.html' title='Grouping XML data using GroupingCollection'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3618905966065698064</id><published>2008-05-28T21:28:00.000-07:00</published><updated>2008-05-30T09:06:13.034-07:00</updated><title type='text'>Object/Array and ObjectProxy/ArrayCollection binding problems</title><content type='html'>Take a look at discussion &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&amp;catid=585&amp;threadid=1360277&amp;enterthread=y"&gt;here&lt;/a&gt;.

&lt;p&gt;Many seems to be stumble upon this problem. Very similar to Object not dispatching any event for property value changes Array also doesn't dispatch any event for items added/deleted from it. Due to this when an object or array is used in the dataProvider of a list based control or comboBox etc any updates to the object or array would not get reflected in the UI. 

&lt;p&gt;The following sample should make it clear.

&lt;p&gt;The first DG is fed with a ArrayCollection of Objects and the second DG has ObjectProxies. Select a item in the DGs and edit the values displayed in the text inputs. To complete the editing hit "Enter". Notice that in the first DG the values don't get reflected immediately where as in second DG it does.

&lt;p&gt;To support Object based dataProviders the list based controls in Flex make a explicit call to ICollectionView.itemUpdated() to force a change event. This is the reason edits in list based controls get propagated to other list based controls when both of them are using the same colletion as input.

&lt;p&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="changeProxy" width="250" height="500"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/objproxytest.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/objproxytest.swf" quality="high" bgcolor="#869ca7"
  width="250" height="500" name="changeProxy" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;
The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/objproxytest.mxml"&gt;here&lt;/a&gt;.

&lt;p&gt;As noted in the forum discussion, when HierarchicalData is built using Objects/Arrays (to represent children) the changes to the Array would not get propagated to ADG. Hence it is necessary to construct the HierarchicalData using ObjectProxies and ArrayCollections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3618905966065698064?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3618905966065698064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3618905966065698064' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3618905966065698064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3618905966065698064'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/05/objectarray-and-objectproxyarraycollect.html' title='Object/Array and ObjectProxy/ArrayCollection binding problems'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5729857564423954596</id><published>2008-05-15T04:34:00.000-07:00</published><updated>2008-05-15T04:40:10.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory leak'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Fixing itemRenderer memory leak in AdvancedDataGrid on columns change</title><content type='html'>Please read the discussion about memory leak &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&amp;threadid=1362560&amp;CFID=25485646&amp;CFTOKEN=fbd1c539430cc8a6-EC3D83DA-C600-BFB3-314113C9AE70746D&amp;jsessionid=48307329b3f25b563a73"&gt;here&lt;/a&gt;.

&lt;p&gt;I think I found the workaround for this issue. We need to override the set columns method in a extended ADG class and add the code to free the dictionary holding on to the itemRenderers. Here is the code.
&lt;p&gt;
&lt;pre&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;mx:AdvancedDataGrid xmlns:mx="http://www.adobe.com/2006/mxml"&amp;gt;
 &amp;lt;mx:Script&amp;gt;
  &amp;lt;![CDATA[
   override public function set columns(value:Array):void
   {
    super.columns = value;
    itemRendererToFactoryMap = new Dictionary(false);
   }
  ]]&amp;gt;
 &amp;lt;/mx:Script&amp;gt;
&amp;lt;/mx:AdvancedDataGrid&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5729857564423954596?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5729857564423954596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5729857564423954596' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5729857564423954596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5729857564423954596'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/05/fixing-itemrenderer-memory-leak-in.html' title='Fixing itemRenderer memory leak in AdvancedDataGrid on columns change'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2951300283733562132</id><published>2008-04-17T20:29:00.000-07:00</published><updated>2008-04-17T20:58:15.731-07:00</updated><title type='text'>Why do people shy away from giving useful 360 degree feedback?</title><content type='html'>I know human psychology is one of most complex things in the universe! But still fail to understand why people shy away from giving useful 360 degree feedback even when it is requested?

&lt;p&gt;I can understand the case where feedback provider holds back this thoughts when there is a fear that his or her name would be revealed and it may spoil a good relationship or cause unnecessary trouble in office or life.

&lt;p&gt;But when the feedback is being provided for a good cause why do people shy away from giving a complete feedback? Why do they provide 180 degree feedback which only leads in a direction but doesn't complete the circle leaving the seaker to ponder all over for the correct point?

&lt;p&gt;Take example of ADG performance poll. There are votes for good, ok and bad. Good and OK are understandable because it is kind of known as testing and many in house scenarios has proved that the performance is acceptable (if not great) in many use cases. But &lt;strong&gt;BAD&lt;/strong&gt; was (kind of) unexpected because of so many hours of testing which has gone in.

&lt;p&gt;Bad performance can arise because of many reasons. For example it can be due to bad performance of GroupingCollection as Doug has kindly pointed out. It can be due to complex custom itemRenderers being used. It can be due to a genuine problem in a particular control flow inside ADG. But without a complete feedabck (pointers to the exact problem faced if not samples) it would be impossible to work on anything. It would be similar to searching for a black coat in a dark room or worse for a non existent coat in a dark room.

&lt;p&gt;This also goes along the same lines as my post about &lt;a href="http://flexpearls.blogspot.com/2008/04/software-patches-goodbadugly.html"&gt;software patches&lt;/a&gt;. If customers don't make use of available &lt;a href="http://flexpearls.blogspot.com/2008/03/advanceddatagrid-and-olap-source-gets.html"&gt;source&lt;/a&gt; and &lt;a href="http://bugs.adobe.com/flex"&gt;public bug base&lt;/a&gt; and provide a good feedback even a very good intention/path provided to help customers goes waste.

&lt;p&gt;In this context I don't know whom to blame for the situation as customers we find ourselves in, because we are not making full use of the easy avenues open in front of us to make a product worthy of the money we have paid for. Or is it that customers have accepted the situation and are showing indifference towards demanding what they rightly deserve?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2951300283733562132?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2951300283733562132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2951300283733562132' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2951300283733562132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2951300283733562132'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/why-do-people-shy-away-from-giving.html' title='Why do people shy away from giving useful 360 degree feedback?'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6373079844441234537</id><published>2008-04-09T20:41:00.001-07:00</published><updated>2008-04-09T22:26:27.067-07:00</updated><title type='text'>Software patches good/bad/ugly?</title><content type='html'>This topic has been in my mind for quite sometime now. It used to reach the top and remain their for sometime whenever &lt;a href="http://www.maxthon.com/"&gt;Maxthon&lt;/a&gt; poped up "A new version available with fixes would you like to install?" dialog.

&lt;p&gt;In early days when the auto update feature was unheard of I used to think software patches are ugly. One needed to keep visiting the website of the product frequently to check whether a patch was available to fix the problems one is facing with the product.

&lt;p&gt;Once patches became more and more popular and available I used to think them as bad. That was becuase sometimes patches used to have more serious problems than the original product. And once you have applied a patch it was not easy to remove it and a complete uninstall-install cycle was required to get back to square one. The  "The update requires a system restart. Restart now?" screen only served to add more fuel to the bad feeling.

&lt;p&gt;Now that auto updates are default and internet is thought as part of your desktop I have beginning to think that patches are good! I think the quality of patches is better now compared to earlier days, may be due to companies having automated testing tools to assure quality.

&lt;p&gt;My latest thought is that "Not having (releasing) patches is really really a bad thing". Pushing a product out of the door having already planned for patches is bad. But at the same time knowing that customers are suffering with a released product, asking them to wait for the next release (which would be more than a year later) is just pathetic. Because every release comes with its own new features and new bugs. 
Companies don't push out new releases without new features as they won't earn any money with a release (patch) aimed at fixing serious bugs or performance issues in the previous release. The problem with this kind of approach is that the attitude about a bug changes in the following way.

&lt;p&gt;Version 1.0 release : We are releasing a great product which would help our users in a great way by boosting their productivity. We would fix all serious bugs soon.
&lt;p&gt;
&lt;p&gt;Customer: Great. Let me use it.
&lt;p&gt;
&lt;p&gt;Version 2.0 release : We have lot of new features for you. In this release we have addressed all serious bugs (read it as bugs reported by great parteners and volume customers) in the previous release.
&lt;p&gt;
&lt;p&gt;Customer: But what about other serious bugs faced by me?
&lt;p&gt;
&lt;p&gt;Company: We would fix all bugs soon. 
&lt;p&gt;
&lt;p&gt;Customer: They are only fixing bugs for the new features and few more bugs from volume customers.
&lt;p&gt;
&lt;p&gt;Version 3.0 release : We have lot of new features. We have revelutionized the workflow. We have rewritten many parts of the code to boost peformance. etc...
Of-course now we are open-source !
&lt;p&gt;
&lt;p&gt;Customer: Now it is Open-source ? Great! But what about bugs which were in 1.0 release? 
&lt;p&gt;
&lt;p&gt;Company: Oh! our customers have lived with these bugs for more than 2 years, now they have almost stopped complaining.....they can live with it! If they complain more, let us ask them to upgrade to the new version and follow a new workflow/API for the same feature which we have introduced. And anyway we are open-source let them grab the source and fix the bug themselves. We can't spend our precious development time over fixing those old bugs.
&lt;p&gt;
&lt;p&gt;Customer: Where I can find a developer and time to study this piece of open-source product and fix bugs for me? ...?....?
&lt;p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;As customers who have paid their hard earned money I think we deserve a better treatment.  Don't you think so?&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6373079844441234537?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6373079844441234537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6373079844441234537' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6373079844441234537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6373079844441234537'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/software-patches-goodbadugly.html' title='Software patches good/bad/ugly?'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3429719264735493928</id><published>2008-04-09T03:00:00.000-07:00</published><updated>2008-04-09T03:08:44.947-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pivot'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAPDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Using Flex OLAP/OLAPDataGrid for doing Pivoting computations</title><content type='html'>Satish has developed a new PivotComponent using OLAPDataGrid and OLAP which can be used to perform pivot analysis of data.

&lt;p&gt;The sample can be found &lt;a href="http://satishtj.googlepages.com/pivotsample"&gt;here&lt;/a&gt;. Drag and drop one or more dimensions into the column and row fields. The results would get displayed as soon as the drop happens. Drag and drop more dimensions into column, row or slicer fields. Use the drop down attached to dimension button to pick specific members of the dimension to do slicing. The sample uses OLAPChart and OLAPDataGrid extensions to display the OLAPResult generated.

&lt;p&gt;&lt;a href="http://flexmadeeasy.blogspot.com/2008/04/here-is-much-awaited-pivotcomponent-in.html"&gt;Description and source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3429719264735493928?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3429719264735493928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3429719264735493928' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3429719264735493928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3429719264735493928'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/using-flex-olapolapdatagrid-for-doing.html' title='Using Flex OLAP/OLAPDataGrid for doing Pivoting computations'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2746806596738797623</id><published>2008-04-07T05:13:00.000-07:00</published><updated>2008-04-07T05:18:57.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom Aggregation.'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Custom Aggregator sample for Flex OLAP</title><content type='html'>Here is a &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPDemo5.swf"&gt;sample&lt;/a&gt; which shows a percent custom aggregator used for OLAP. The sample shows computation of percentage of values to the total value. &lt;em&gt;The total value is assumed to be known before hand.&lt;/em&gt; 

&lt;p&gt;The PercentAgg class implements the &lt;a href="http://livedocs.adobe.com/flex/3/langref/mx/olap/IOLAPCustomAggregator.html"&gt;IOLAPCustomAggregator &lt;/a&gt;interface. The constructor takes the total value as input and uses it to compute the percentage of values in the computeEnd and computeObjectEnd functions.

&lt;p&gt;The sample also shows how OLAPAttribute class can be extended to OLAPTotal to replace the "(All)" value with a custom name "Total". 

&lt;p&gt;The sample also shows how OlapDataGrid can be created in AS and itemRendererProviders can be supplied to it and values displayed in ODG can be styled.

Here is the complete &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPPercent.zip"&gt;source&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2746806596738797623?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2746806596738797623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2746806596738797623' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2746806596738797623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2746806596738797623'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/custom-aggregator-sample-for-flex-olap.html' title='Custom Aggregator sample for Flex OLAP'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1425944377299936795</id><published>2008-04-07T03:47:00.000-07:00</published><updated>2008-04-07T03:58:32.574-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom Aggregation.'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Writing a Custom Aggregator for Flex OLAP</title><content type='html'>Writing a custom aggregator for OLAP involves implementing the IOLAPCustomAggregator interface. It is easy to write a custom one based on the default ones. The default SUM, AVARAGE, MIN, MAX and COUNT aggregators source can be found in the mx.olap.aggregators directory.

&lt;p&gt;The SUM, MIN, MAX and COUNT aggregators are all simple and acutally doesn't require any special handling as they are linear. The AVARAGE aggregator is special because avarage of avarages wouldn't give the correct result and hence we need to maintain proper information to arrive at the correct result.

&lt;p&gt;The following sample shows how this is achieved.

&lt;a href="http://2.bp.blogspot.com/_sh8W7P3dJgY/R_n8-_nX2dI/AAAAAAAAABE/aYFHSoLGw_A/s1600-h/CustomAgg.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_sh8W7P3dJgY/R_n8-_nX2dI/AAAAAAAAABE/aYFHSoLGw_A/s400/CustomAgg.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5186454605052500434" /&gt;&lt;/a&gt;

&lt;p&gt;IOLAPCustomAggregator has 6 functions can they can be divided into two sets.

&lt;p&gt;1. computeBegin,computeLoop and computeEnd. These functions are called to initialize, compute and return the simple aggregation value. 

&lt;p&gt;Suppose 1..8 are the input values and they need to avaraged as two different sets 1..5 and 6..8. The sequence of function calls is one computeBegin, one or many calls to computeLoop and  one call to computeEnd. 

1. computeBegin can be used to prepare for a fresh computation.
2. computeLoop is the place where the acutal computation takes place. This function would get called repeatedly to add new input values to the aggregation.
3. computeEnd is supposed to return the value of the computation. This is called when cube decides that no new input values would get added to this aggregation and it is ready to receive the final value.

&lt;p&gt;2. computeObjectBegin, computeObjectLoop, computeObjectEnd. These functions are called to initialize, compute  and return the &lt;strong&gt;aggregation of aggregations&lt;/strong&gt;. 

&lt;p&gt;The second set of calls would be, one call to computeObjectBegin, one or many calls to computeObjectLoop (depending on the number of aggregated values) and one call to computeObjectEnd.

&lt;p&gt;As shown in the image these functions are supposed to compute the avarage of avarages. As the first set of functions saved the sum and count values separately the task is easy. We need just compute the sum of both these values from each avarage object.

&lt;p&gt;In computeObjectBegin the first value to start the computation is passed. In computeObjectLoop the the computation is carried forward with additional values. In computeObjectEnd the result of the computation should be returned.

Hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1425944377299936795?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1425944377299936795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1425944377299936795' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1425944377299936795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1425944377299936795'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/writing-custom-aggregator-for-flex-olap.html' title='Writing a Custom Aggregator for Flex OLAP'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_sh8W7P3dJgY/R_n8-_nX2dI/AAAAAAAAABE/aYFHSoLGw_A/s72-c/CustomAgg.JPG' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3417417718310406762</id><published>2008-04-06T23:42:00.000-07:00</published><updated>2008-04-07T09:46:33.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>AdvancedDataGrid performance poll</title><content type='html'>Hello AdvancedDataGrid users !

&lt;p&gt;I have added two polls to the end of my blog. One for suggesting in what areas should ADG performance improve. Second one for overall performance of ADG in your projects/apps.

&lt;p&gt;Please spare some time out of your busy schedule and take the polls.

&lt;p&gt;I would urge you take both the polls because just taking one poll many not deliver the exact picture. For example if you say vertical scrolling performance needs to be improved we don't know whether the app is hurt by its performance or it is that it would do better with a performance boost. 

&lt;p&gt;Thanks for your time !

&lt;p&gt;Of-course if you would like to send me a sample showing poor performance in a particular/general context please do by sending a &lt;a href="mailto:sreenivas.ramaswamy@gmail.com"&gt;mail&lt;/a&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;I am seeing more number of votes on Bad than expected :(

&lt;p&gt;I would appreciate if you leave a comment as to which particular area of ADG you found the performance to be so poor that it forced you turn it down. I am asking this because votes are also going in favor of Good and OK. It would be of great help if I get a pointer in that direction so that we can study that area of the code more and see what performance improvements can be done. Thanks!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3417417718310406762?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3417417718310406762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3417417718310406762' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3417417718310406762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3417417718310406762'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/04/advanceddatagrid-performance-poll.html' title='AdvancedDataGrid performance poll'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2939827843978933346</id><published>2008-03-27T23:31:00.000-07:00</published><updated>2008-03-27T23:35:00.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Delegate'/><title type='text'>Documentation about Creating a Automation delegate for custom components in Flex</title><content type='html'>Documentation and sammple about how to go about creating an automation delegate for custom components in Flex is detailed &lt;a href="http://livedocs.adobe.com/flex/3/html/help.html?content=functest_components2_13.html"&gt;here&lt;/a&gt;

&lt;p&gt;It also has step by step description of delegate creation for the RandomWalk component created by &lt;a href="http://www.quietlyscheming.com/"&gt;Ely&lt;/a&gt;.

&lt;p&gt;Hope it helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2939827843978933346?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2939827843978933346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2939827843978933346' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2939827843978933346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2939827843978933346'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/documentation-about-creating-automation.html' title='Documentation about Creating a Automation delegate for custom components in Flex'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5584921668408151700</id><published>2008-03-19T22:46:00.000-07:00</published><updated>2008-03-19T23:12:12.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FlexBuilder Pro'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='source'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>AdvancedDataGrid, Charts and OLAP source gets unziped in FlexBuilder Pro version</title><content type='html'>What I thought is a known fact seems not so widely known. Hence posting it.

&lt;p&gt;When &lt;strong&gt;FlexBuilder Pro&lt;/strong&gt; version is bought and a valid licensce key is entered the source code for the complete datavisulation.swc would get unzipped and get placed under 

&lt;strong&gt;&lt;p&gt;&amp;lt;FlexBuilder installation direcotry&amp;gt;sdk/3.0.0/fbpro/...&lt;/p&gt;&lt;/strong&gt; 

&lt;p&gt;directory. Which means users would get access to AdvancedDataGrid, Charts and OLAP source code.

&lt;p&gt;It is &lt;strong&gt;not open-source&lt;/strong&gt; but source is available for you to take a look and override functions with more confidence and knowledge of the internal workings. And of-course suggest/complain ! 

&lt;p&gt;Enjoy !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5584921668408151700?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5584921668408151700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5584921668408151700' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5584921668408151700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5584921668408151700'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/advanceddatagrid-and-olap-source-gets.html' title='AdvancedDataGrid, Charts and OLAP source gets unziped in FlexBuilder Pro version'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-4702168961035137914</id><published>2008-03-13T06:00:00.000-07:00</published><updated>2008-03-13T06:14:44.425-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OLAPTimeDimension'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Introducing OLAPTimeDimension for OLAP</title><content type='html'>In &lt;a href="http://flexpearls.blogspot.com/2008/03/simple-uses-of-olap.html"&gt;this&lt;/a&gt; sample though the data contained date information we didn't use it while building the OLAP cube. The reason was simple. The default OLAP implmentation in Flex 3 cannot handle dates in that format. It requires the date to be broken down into its components like year and month. If half year and quarter information is required that needs to be added to the flat data. That is a great pain point.

&lt;p&gt;Here is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPSamples.zip"&gt;OLAPTimeDimension&lt;/a&gt; to the rescue. It can be introduced as any other dimension in the OLAPCube schema and then configured to return year, half year, quarter, month and day in any combination. 

&lt;pre&gt;
&amp;lt;mx:OLAPCube id="salesCube" &amp;gt;

 &amp;lt;mx:OLAPDimension name="SalesData" &amp;gt;
   &amp;lt;mx:OLAPAttribute name="Company" dataField="company" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Region" dataField="region" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Market" dataField="market" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Product" dataField="product" /&amp;gt;
    
   &amp;lt;mx:OLAPHierarchy name="Region-Market-Store" &amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Company" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Region" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Market" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Product" /&amp;gt;
   &amp;lt;/mx:OLAPHierarchy&amp;gt;
 &amp;lt;/mx:OLAPDimension&amp;gt;
  
 &amp;lt;local:OLAPTimeDimension name="Years" dataField="date" /&amp;gt;
  
 &amp;lt;mx:OLAPMeasure name="Revenue" dataField="revenue" /&amp;gt;
  
&amp;lt;/mx:OLAPCube&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Using this we get the following result where in we can query revenue for different years. 

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="OLAPDemo4" width="400" height="400"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/OLAPDemo4.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/OLAPDemo4.swf" quality="high" bgcolor="#869ca7"
  width="400" height="400" name="OLAPDemo4" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;It can be easily extended to query quarters and months by setting includeQuarter and includeMonth to true on OLAPTimeDimension.

The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPSamples.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-4702168961035137914?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/4702168961035137914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=4702168961035137914' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4702168961035137914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4702168961035137914'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/introducing-olaptimedimension-for-olap.html' title='Introducing OLAPTimeDimension for OLAP'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6100908637721675808</id><published>2008-03-13T05:23:00.000-07:00</published><updated>2008-03-13T06:00:12.539-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Simple uses of OLAP</title><content type='html'>In Flex 3 OLAP APIs were introduced. And here is a sample showing how it can be used in simple data processing.

&lt;p&gt;The sample shows how a companys product revenue over regions and markets can be compared.

Click the "Create cube" button to process the input data which looks like this

&lt;pre&gt;
&amp;lt;row&amp;gt;
  &amp;lt;company&amp;gt;Fiction&amp;lt;/company&amp;gt;
  &amp;lt;region&amp;gt;Asia&amp;lt;/region&amp;gt;
  &amp;lt;market&amp;gt;Digital publishing&amp;lt;/market&amp;gt;
  &amp;lt;product&amp;gt;Frames&amp;lt;/product&amp;gt;
  &amp;lt;date&amp;gt;3/31/2005&amp;lt;/date&amp;gt;
  &amp;lt;revenue&amp;gt;10&amp;lt;/revenue&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/pre&gt;

&lt;p&gt;and build the OLAP cube. Clicking on the "Query Revenue with Product by Region" button would display the result in OLAPDataGrid. The query returns the total revenue comparing product by region across all years (2005 and 2006 in the sample data case). The last row and last column display the totals by product and totals by region respectively.

&lt;p&gt;Now different markets can be selected from the ComboBox and revenues from different markets can be compared.

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="OLAPDemo3" width="400" height="400"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/OLAPDemo3.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/OLAPDemo3.swf" quality="high" bgcolor="#869ca7"
  width="400" height="400" name="OLAPDemo3" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/OLAPSamples.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6100908637721675808?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6100908637721675808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6100908637721675808' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6100908637721675808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6100908637721675808'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/simple-uses-of-olap.html' title='Simple uses of OLAP'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6089206544973554986</id><published>2008-03-12T23:42:00.000-07:00</published><updated>2008-03-12T23:50:47.940-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OLAPCube'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='OLAP'/><title type='text'>Creating OLAPCube in AS</title><content type='html'>In Flex 3 OLAP APIs were introduced and there have been many queries about how to create a OLAPCube in AS instead of defining it in MXML.

Here is a sample :
&lt;pre&gt;

private var salesCube:OLAPCube;

private function createCube():void
{
 salesCube = new OLAPCube();

 var dim1:OLAPDimension = new OLAPDimension("SalesData");

 //add attributes to the dimension
 var attr1:OLAPAttribute = new OLAPAttribute("Region");
 attr1.dataField = "region";

 var attr2:OLAPAttribute = new OLAPAttribute("Market");
 attr2.dataField = "market";

 var attr3:OLAPAttribute = new OLAPAttribute("Store");
 attr3.dataField = "store";

 var attr4:OLAPAttribute = new OLAPAttribute("LineOfBusiness");
 attr4.dataField = "line_of_business";

 var attr5:OLAPAttribute = new OLAPAttribute("Model");
 attr5.dataField = "model";

 dim1.attributes = new ArrayCollection([ attr1, attr2, attr3, attr4, attr5 ]);

 //add a user defined hierarchy   
 var regionHierarchy:OLAPHierarchy = new OLAPHierarchy("Region-Market-Store");

 //define the levels of the hierarchy
 var level1:OLAPLevel = new OLAPLevel();
 level1.attributeName = "Region" ;

 var level2:OLAPLevel = new OLAPLevel();
 level2.attributeName = "Market" ;

 var level3:OLAPLevel = new OLAPLevel();
 level3.attributeName = "Store" ;

 var level4:OLAPLevel = new OLAPLevel();
 level4.attributeName = "LineOfBusiness" ;

 var level5:OLAPLevel = new OLAPLevel();
 level5.attributeName = "Model" ;

  //add levels to the hierarchy
  regionHierarchy.levels = new ArrayCollection([ level1, level2, level3, level4, level5 ]);

  //add hierarchy to the dim
 dim1.hierarchies = new ArrayCollection([ regionHierarchy ]);

 //more dimensions can be defined here

 var measure:OLAPMeasure = new OLAPMeasure("Revenue");
 measure.dataField = "revenue" ;

 //more measures can be defined here

 //add the dimensions and measures to the cube.
 salesCube.elements = [ dim1, measure ];
}
&lt;/pre&gt;

This creates the same OLAPCube as the following in MXML

&lt;pre&gt;
&amp;lt;mx:OLAPCube id="salesCube" &amp;gt;

 &amp;lt;mx:OLAPDimension name="SalesData" &amp;gt;
   &amp;lt;mx:OLAPAttribute name="Region" dataField="region" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Market" dataField="market" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Store" dataField="store" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="LineOfBusiness" dataField="line_of_business" /&amp;gt;
   &amp;lt;mx:OLAPAttribute name="Model" dataField="model" /&amp;gt;
    
   &amp;lt;mx:OLAPHierarchy name="Region-Market-Store" &amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Region" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Market" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Store" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="LineOfBusiness" /&amp;gt;
    &amp;lt;mx:OLAPLevel attributeName="Model" /&amp;gt;
   &amp;lt;/mx:OLAPHierarchy&amp;gt;
 &amp;lt;/mx:OLAPDimension&amp;gt;
  
 &amp;lt;mx:OLAPMeasure name="Revenue" dataField="revenue" /&amp;gt;
  
&amp;lt;/mx:OLAPCube&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6089206544973554986?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6089206544973554986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6089206544973554986' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6089206544973554986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6089206544973554986'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/creating-olapcube-in-as.html' title='Creating OLAPCube in AS'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5861988376787672184</id><published>2008-03-10T22:39:00.000-07:00</published><updated>2009-10-07T19:08:29.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateChooser'/><category scheme='http://www.blogger.com/atom/ns#' term='backgroundColor'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>DateChooser with support for backgroundColoring some dates</title><content type='html'>I got a query recently asking whether it is possible to have the DateChooser highlight certain special dates with a different background color. The query was accompanided by a DateChooser code which achieved this by using the TexField.backgroud and TexField.backgroudColor properties (similar to my other posts for DG row background coloring). But the draw back of the approach was that selection and roll over feedback was not working.

&lt;p&gt;I took a look at DateChooser and CalendarLayout and realized that with the current design/implmentation it was not possible to add the backgroundColor support. The selection and rollOver indicators were lower in z order than date UITextFields.

&lt;p&gt;I modified the CalenderLayout code to have three layers (UIComponents). One for background, second for indicators and third one for the dates. After modifying the addChild* and removeChild calls refer to the appropriate layers, the remaining work was to add "speicalDates" and "specialDatesColor" property and wire them up at appropirate places (commitProperties and updateDisplayList) to achive the following result :

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="DCBg" width="400" height="300"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/DateChooserBG.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/DateChooserBG.swf" quality="high" bgcolor="#869ca7"
  width="400" height="300" name="DCBg" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;I have randomnly generated the special dates in the above sample to keep the sample live on any day it is viewed!

&lt;p&gt;I have added a alpha value of 0.7 in DateChooserIndicator to make the selection indicator show through the backgroundColor. Feel free to tweak this value to your flavor.

&lt;p&gt;The project source to build the Flex3Ex.swc is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/Flex3Ex.zip"&gt;here&lt;/a&gt;. It contains the modified DateChooser and CalendarLayout classes. I posted the complete Flex project here because &lt;a href="http://www.blogger.com/profile/04684753235465087592"&gt;Travis&lt;/a&gt; pointed out that it is difficult for newbies to understand how to use the component source files. Thanks Travis!

&lt;p&gt;The source for the sample app is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DateChooserBg.mxml"&gt;here&lt;/a&gt;. 

&lt;p&gt;The components can be further enhanced to support multiple specialDates (array of array of dates) and multiple specialDatesColors. 
&lt;p&gt;&lt;p&gt;
Update: I got to implement this. Source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/Flex3Ex2.zip"&gt;here&lt;/a&gt;.
&lt;p&gt;&lt;p&gt;
&lt;span style="font-weight:bold;"&gt;Update:&lt;/span&gt; I have updated the &lt;a href="http://sreenivas.ramaswamy.googlepages.com/Flex3Ex3.zip"&gt;source&lt;/a&gt; to support the following:
&lt;p&gt;
Now dates can be specified as strings "06/01/2009" (for 1st June 2009) but make sure that it succeeds to pass through Date.parse function and returns a valid Date.
&lt;p&gt;&lt;p&gt;Date ranges can be specified as follows: 
&lt;p&gt;&lt;p&gt;{ rangeStart:"06/01/2009", rangeEnd:"06/05/2009" }
&lt;p&gt;&lt;p&gt;
&lt;b&gt;Update:&lt;/b&gt; There seems to be some problem with library path handling etc due to which a swc is not getting picked up properly in FB.

The work around I came up for this is to include the Flex3Ex/src directory in the source path of the project as shown &lt;a href="http://sreenivas.ramaswamy.googlepages.com/ProjectProperties.PNG"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5861988376787672184?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5861988376787672184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5861988376787672184' title='103 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5861988376787672184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5861988376787672184'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/03/datechooser-with-support-for.html' title='DateChooser with support for backgroundColoring some dates'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>103</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7707605963324246373</id><published>2008-02-29T02:47:00.000-08:00</published><updated>2008-02-29T19:27:56.996-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingField'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='IHierachicalCollectionView'/><category scheme='http://www.blogger.com/atom/ns#' term='filter'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='groupingFunction'/><title type='text'>GroupingCollection to group mails on Date and Subject</title><content type='html'>Here is a sample I wrote using GC to group mails according to Date and Subject very similar to Outlook. This sample serves to show the complex ways in which GC can be configures and used.

&lt;p&gt;&lt;strong&gt;Subject grouping:&lt;/strong&gt; The sample uses GroupingField.groupingFunction and GroupingField.compareFunction to achive the Subject grouping even when subject line text is prefixed with RE:, FW: etc. Grouping.groupingObjectFunction is used to supply a custom grouping object MailGroup which has a date field getter function to return the maximum date of the child mail items.

&lt;p&gt;&lt;strong&gt;Date grouping:&lt;/strong&gt; Again groupingFunction is used to form diffrent groups of mails based on the date value. 

&lt;p&gt;The "show unread mails" option can be used to remove the read mails from the view. This shows filtering applied to the HierarchicalCollectionView which ADG creates internally when a GroupingCollection (or anything which implements IHierarchicalData) is supplied as the dataProvider.

&lt;p&gt;The "highlight unread mails" option uses the ADG.styleFunction property to hightlight the unread mails by making them bold.

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="MailGrouping" width="500" height="550"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/MailGrouping.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/MailGrouping.swf" quality="high" bgcolor="#869ca7"
  width="500" height="550" name="MailGrouping" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;


&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/MailGrouping.zip"&gt;here&lt;/a&gt;

&lt;p&gt;Please note I have a tweak in the sample to keep it ever-green, that is the date values of the mail items are generated at runtime than hard coded.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7707605963324246373?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7707605963324246373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7707605963324246373' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7707605963324246373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7707605963324246373'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/groupingcollection-to-group-mails-on.html' title='GroupingCollection to group mails on Date and Subject'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2901978866890041091</id><published>2008-02-25T22:34:00.000-08:00</published><updated>2008-02-25T23:04:06.627-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TileList'/><category scheme='http://www.blogger.com/atom/ns#' term='Print'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>PrintTileList along the lines of PrintDataGrid.</title><content type='html'>After seeing &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&amp;catid=585&amp;threadid=1340414&amp;enterthread=y"&gt;this&lt;/a&gt; query I thought it should be easy to get it to work. So spent 2 hours (that is little more than expected, isn't it!) and here is the result.

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="PrintTile" width="400" height="300"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/PrintTile.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/PrintTile.swf" quality="high" bgcolor="#869ca7"
  width="400" height="300" name="PrintTile" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/PrintTileList.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2901978866890041091?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2901978866890041091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2901978866890041091' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2901978866890041091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2901978866890041091'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/printtilelist-along-lines-of.html' title='PrintTileList along the lines of PrintDataGrid.'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-483073239404208454</id><published>2008-02-23T04:10:00.000-08:00</published><updated>2008-02-23T04:22:19.601-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Drag drop'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Drag-drop between two containers instead of list based controls in Flex</title><content type='html'>I keep seeing many questions on forums about drag-drop of images between two 
containers or between a control and a container. So I thought a sample may help.

&lt;p&gt;The sample shows a side toolbox from which cursors can be dragged and dropped into the canvas on the right hand side. The code is simple so I won't try to explain the steps in detail here.

&lt;p&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="DragDropContainer" width="450" height="300"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/DragDropContainer.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/DragDropContainer.swf" quality="high" bgcolor="#869ca7"
  width="450" height="300" name="DragDropContainer" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;


&lt;p&gt;The source for this sample is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DragDropSample.zip"&gt;here&lt;/a&gt;.

&lt;p&gt;The source for dragging and dropping items between a DataGrid and container can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DropToPanel.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-483073239404208454?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/483073239404208454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=483073239404208454' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/483073239404208454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/483073239404208454'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/drag-drop-images-between-tool-bar-and.html' title='Drag-drop between two containers instead of list based controls in Flex'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7569277218737358436</id><published>2008-02-20T22:08:00.000-08:00</published><updated>2008-02-23T04:42:39.940-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alternate row colors per column'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridColumn'/><title type='text'>Alternate row color in DataGrid per DataGridColumn</title><content type='html'>The idea came from a flexcoders post &lt;a href="http://tech.groups.yahoo.com/group/flexcoders/message/102863"&gt;here&lt;/a&gt;. After attempting the previous example of row background colors in ADG I thought it should be easy to achive this which resulted in this post.

&lt;p&gt;I extended the DGColumn and added a "alternatingItemColors" style it so that it would be possible to set it per column. 

&lt;p&gt;I extended the DGItemRenderer and used the background and backgroundColor properties to set the items background color. I added logic in a overridden validateNow function to pick up the color from the alternatingItemColors color array.

&lt;p&gt;The drawback of this approach is that the selection feedback gets almost hidden by the background coloring which would not be the case if &lt;a href="http://www.mikenimer.com/index.cfm/2006/10/3/BackgroundRowColor-DataGrid-component"&gt;the drawRowBackground function is overridden.&lt;/a&gt;

&lt;p&gt;The result :

&lt;p&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="FlatSummary" width="250" height="250"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/AlternateDGColumnColors.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/AlternateDGColumnColors.swf" quality="high" bgcolor="#869ca7"
  width="250" height="250" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DGColumnItemColors.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7569277218737358436?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7569277218737358436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7569277218737358436' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7569277218737358436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7569277218737358436'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/alternate-row-color-in-datagrid-per.html' title='Alternate row color in DataGrid per DataGridColumn'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5222958971959644962</id><published>2008-02-20T21:03:00.000-08:00</published><updated>2008-02-23T04:44:37.791-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='backgroundColor'/><category scheme='http://www.blogger.com/atom/ns#' term='row'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Changing row background color in AdvancedDataGrid</title><content type='html'>Changing the row backgroundColor in AdvancedDataGrid to highlight few rows is easy (though not possible out of the box). 

&lt;p&gt;I have used a different approach than &lt;a href="http://www.mikenimer.com/index.cfm/2006/10/3/BackgroundRowColor-DataGrid-component"&gt;overriding the drawRowBackground function&lt;/a&gt; used for DG. The drawback of this approach is that the selection feedback gets almost hidden by the background coloring. If the intention is to highlight a search or hightlight a particular values this should not be a serious problem.

&lt;p&gt;The default itemRenderer ADGItemRenderer extends from UITextField (for perforamnce reasons) which doesn't have a backgroundColor style. Hence it is not possible to do it out of the box. But TextField (parent of UITextField) has &lt;strong&gt;background&lt;/strong&gt; and &lt;strong&gt;backgroundColor&lt;/strong&gt; properties which can be set to change the backgroundColor of the TextField. 

&lt;p&gt;I have created a new custom itemRenderer ADGItemRendererEx which derives from ADGItemRenderer. I have added a "rowColor" style to this and use this style value to set the TextFields background color.

&lt;p&gt;By providing a styleFunction to ADG we get control to return any styles we want to be set on the itemRenderer. Any logic to determine a particular rows color can go into this function. The return value is a object with style names as properties and style values as proprety-values. For ex:

&lt;p&gt; return { rowColor:0xFF0000, fontWeight:"bold" };

&lt;p&gt;If function logic decides not to change the styles it can return an empty object.

&lt;p&gt; The following sample shows the result. By typing any string in the text box the particular row containing the searched string is highlighted. User can choose to search for either company column or product column.

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="FlatSummary" width="350" height="500"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/ADGRowBackground.swf " /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/ADGRowBackground.swf " quality="high" bgcolor="#869ca7"
  width="350" height="500" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/ADGRowBackground.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5222958971959644962?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5222958971959644962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5222958971959644962' title='61 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5222958971959644962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5222958971959644962'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/row-background-color-in.html' title='Changing row background color in AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>61</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-4316165216630845810</id><published>2008-02-20T01:32:00.000-08:00</published><updated>2008-02-20T01:50:08.895-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridColumn'/><category scheme='http://www.blogger.com/atom/ns#' term='Auto generating columns'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGridColumn'/><title type='text'>Auto generating DataGrid columns for XML data</title><content type='html'>&lt;p&gt;When we have dynamic XML data as follows

&lt;pre&gt;
&lt;p&gt; &amp;lt;employees&amp;gt;
&lt;p&gt;  &amp;lt;employee&amp;gt;
&lt;p&gt;   &amp;lt;name&amp;gt;Christina Coenraets&amp;lt;/name&amp;gt;
&lt;p&gt;   &amp;lt;phone&amp;gt;555-219-2270&amp;lt;/phone&amp;gt;
&lt;p&gt;   &amp;lt;email&amp;gt;ccoenraets@fictitious.com&amp;lt;/email&amp;gt;
&lt;p&gt;   &amp;lt;active&amp;gt;true&amp;lt;/active&amp;gt;
&lt;p&gt;  &amp;lt;/employee&amp;gt;
&lt;p&gt;  &amp;lt;employee&amp;gt;
&lt;p&gt;  &amp;lt;name&amp;gt;Louis Freligh&amp;lt;/name&amp;gt;
&lt;p&gt;  &amp;lt;phone&amp;gt;555-219-2100&amp;lt;/phone&amp;gt;
&lt;p&gt;  &amp;lt;email&amp;gt;lfreligh@fictitious.com&amp;lt;/email&amp;gt;
&lt;p&gt;  &amp;lt;active&amp;gt;true&amp;lt;/active&amp;gt;
&lt;p&gt;   &amp;lt;/employee&amp;gt;
&lt;p&gt;&amp;lt;/employees&amp;gt;
&lt;/pre&gt;

&lt;p&gt;or in the form of attributes

&lt;pre&gt;
&lt;p&gt;&amp;lt;employees&amp;gt;
&lt;p&gt;&amp;lt;employee name="Christina Coenraets" 
&lt;p&gt; phone="555-219-2270"
&lt;p&gt; email="ccoenraets@fictitious.com"
&lt;p&gt; active="true" /&amp;gt;
&lt;p&gt;&amp;lt;employee name="Louis Freligh" 
&lt;p&gt; phone="555-219-2100" 
&lt;p&gt; email="lfreligh@fictitious.com"
&lt;p&gt; active="true" /&amp;gt;
&lt;p&gt;&amp;lt;/employees&amp;gt;
&lt;/pre&gt;

&lt;p&gt;and feed into DG or ADG it won't create columns auto-magically as it does for Object data type. This may be because it is difficult to decide whether you want to display the child nodes as columns or attributes of nodes. And may be it was not appropriate to clutter the API with one more flag to do this.

&lt;p&gt;I wrote the following code to get this working.

&lt;pre&gt;
private function generateCols(input:XMLList, 
 useAttributes:Boolean = false):Array
{
 var e1:XML = input[0];
 var columns:Array = [];
 var children:XMLList ;
 if (useAttributes)
    children = e1.attributes();
 else
    children = e1.children();
 for each(var child:XML in children)
 {
    var col:DataGridColumn = new DataGridColumn();
    col.dataField = useAttributes ? "@" + child.name() : child.name();
    
    var fieldName:String = child.name();
    col.headerText = fieldName.charAt(0).toUpperCase() + fieldName.substr(1);
    columns.push(col);
 }
 return columns;
}
&lt;/pre&gt;

&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DGToXML.mxml"&gt;here&lt;/a&gt;

&lt;p&gt;The thread related to this post is &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&amp;threadid=1337935#4860253"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-4316165216630845810?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/4316165216630845810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=4316165216630845810' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4316165216630845810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4316165216630845810'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/02/generating-dg-columns-for-xml-data.html' title='Auto generating DataGrid columns for XML data'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5547872947982073405</id><published>2008-01-28T01:01:00.000-08:00</published><updated>2008-01-28T01:42:39.290-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tree'/><category scheme='http://www.blogger.com/atom/ns#' term='TreeView'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Sort'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Using AdvancedDataGrid as a tree control with sorting</title><content type='html'>The AdvancedDataGrid control can be configured and used as a simple Tree control with sorting support (which is not available in the Tree control).

&lt;p&gt;The following example shows how.

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="ADGasTree" width="400" height="475"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/ADGasTree.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/ADGasTree.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;When hierarchical XML (or Object based) data is fed into a &lt;b&gt;HierachicalData&lt;/b&gt; (which implements IHierachicalData) and set as dataProvider to ADG it internally converts it into a &lt;b&gt;HierarchicalCollectionView&lt;/b&gt; (implementing IHierarchicalCollectionView). The good news is that HierarchicalCollectionView provides &lt;b&gt; the sort and filtering APIs which can be used to sort and filter the data very similar to flat data&lt;/b&gt;. 

&lt;p&gt;Click on the "Simple sort" button to see how the data gets sorted recursively. It doesn't do a good job as it mixes up parent and leaf items. If you are one those who expects everything according to the alphabetical order you may like it !

&lt;p&gt;Click on the "Custom sort" button to see how the sorting can be customized to show the parent items at the top and leaf items at the bottom. The custom sort function uses the IHierarchicalData.canHaveChildren API to move the parent items up the ladder.

&lt;p&gt;"Remove sort" does the obvious.

&lt;p&gt;The &lt;a href="http://sreenivas.ramaswamy.googlepages.com/ADGasTree.mxml"&gt;source&lt;/a&gt; and &lt;a href="http://sreenivas.ramaswamy.googlepages.com/treeData.xml"&gt;data&lt;/a&gt; used for example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5547872947982073405?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5547872947982073405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5547872947982073405' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5547872947982073405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5547872947982073405'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/01/using-advanceddatagrid-as-tree-control.html' title='Using AdvancedDataGrid as a tree control with sorting'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3271932696508104190</id><published>2008-01-22T21:40:00.000-08:00</published><updated>2008-01-22T22:13:43.205-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='nested data'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGridColumn'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGridColumn'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Extending DGColumn and ADGColumn to handle nested data fields.</title><content type='html'>&lt;p&gt;I have seen numerous questions regarding how to specify DataGridColumn.dataField when the data is nested (object or XML). Developers attempt to use "datafield1.datafield2.datafield3" to find out that it doesn't work !&lt;/p&gt;

&lt;p&gt;The data might look like this  :
&lt;pre&gt;
&lt;p&gt;&amp;lt;mx:XMLList id="testData" xmlns=""&amp;gt;
&lt;p&gt;&amp;lt;root&amp;gt;
&lt;p&gt;   &amp;lt;item&amp;gt;
&lt;p&gt;      &amp;lt;childItem&amp;gt;
&lt;p&gt;        &amp;lt;name&amp;gt;India Flex group&amp;lt;/name&amp;gt;
&lt;p&gt;        &amp;lt;mail&amp;gt;indiafx@gmail.com&amp;lt;/mail&amp;gt;
&lt;p&gt;      &amp;lt;/childItem&amp;gt;
&lt;p&gt;      &amp;lt;location&amp;gt;India&amp;lt;/location&amp;gt;
&lt;p&gt;   &amp;lt;/item&amp;gt;
&lt;p&gt;   &amp;lt;item&amp;gt;
&lt;p&gt;      &amp;lt;childItem&amp;gt;
&lt;p&gt;        &amp;lt;name&amp;gt;Singapore Flex group&amp;lt;/name&amp;gt;
&lt;p&gt;        &amp;lt;mail&amp;gt;singaporefx@gmail.com&amp;lt;/mail&amp;gt;
&lt;p&gt;      &amp;lt;/childItem&amp;gt;
&lt;p&gt;      &amp;lt;location&amp;gt;Singapore&amp;lt;/location&amp;gt;
&lt;p&gt;   &amp;lt;/item&amp;gt;
&lt;p&gt;   &amp;lt;item&amp;gt;
&lt;p&gt;     &amp;lt;childItem&amp;gt;
&lt;p&gt;       &amp;lt;name&amp;gt;Sreenivas&amp;lt;/name&amp;gt;
&lt;p&gt;       &amp;lt;mail&amp;gt;sreenivas.ramaswamy@gmail.com&amp;lt;/mail&amp;gt;
&lt;p&gt;     &amp;lt;/childItem&amp;gt;
&lt;p&gt;     &amp;lt;location&amp;gt;Bangalore&amp;lt;/location&amp;gt;
&lt;p&gt;   &amp;lt;/item&amp;gt;
&lt;p&gt;&amp;lt;/root&amp;gt;
&lt;p&gt;&amp;lt;/mx:XMLList&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The answer has always (most of the time?) been to use DataGrid.labelFunction. I dislike the solution because it requires the developer to do this again and again for every column and every usage. I find it easier to extend the DataGridColumn and override the itemToLabel function to do the needful.&lt;/p&gt;

&lt;p&gt;The usage is simple. The Nested and ordinary columns can be mixed or only nested columns can be used as the logic kicks in only when "." is present in dataField value.

&lt;pre&gt;
&lt;p&gt;&amp;lt;mx:AdvancedDataGrid dataProvider="{testData.item}"&amp;gt;
&lt;p&gt;  &amp;lt;mx:columns&amp;gt;
&lt;p&gt;    &amp;lt;local:AdvancedDataGridColumnNested &lt;b&gt;dataField="childItem.name"&lt;/b&gt; headerText="Name" width="150"/&amp;gt;
&lt;p&gt;    &amp;lt;local:AdvancedDataGridColumnNested &lt;b&gt;dataField="childItem.mail"&lt;/b&gt; headerText="email" width="100"/&amp;gt;
&lt;p&gt;    &amp;lt;mx:AdvancedDataGridColumn dataField="location" headerText="Location" /&amp;gt;
&lt;p&gt;  &amp;lt;/mx:columns&amp;gt;
&lt;p&gt;&amp;lt;/mx:AdvancedDataGrid&amp;gt;
&lt;p&gt;
&lt;p&gt;&amp;lt;mx:DataGrid dataProvider="{testData.item}"&amp;gt;
&lt;p&gt;   &amp;lt;mx:columns&amp;gt;
&lt;p&gt;     &amp;lt;local:DataGridColumnNested &lt;b&gt;dataField="childItem.name" &lt;/b&gt;headerText="Name" width="150"/&amp;gt;
&lt;p&gt;     &amp;lt;local:DataGridColumnNested &lt;b&gt;dataField="childItem.mail" &lt;/b&gt;headerText="email" width="100"/&amp;gt;
&lt;p&gt;     &amp;lt;mx:DataGridColumn dataField="location" headerText="Location" /&amp;gt;
&lt;p&gt;   &amp;lt;/mx:columns&amp;gt;
&lt;p&gt;&amp;lt;/mx:DataGrid&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The result looks like this:

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="FlatSummary" width="420" height="420"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/DGTest.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/DGTest.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The data can be nested to any level not just two. The same logic takes care of everything!&lt;/p&gt;

&lt;p&gt;Here are the source files for &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DataGridColumnNested.as"&gt;DataGridColumnNested&lt;/a&gt; and &lt;a href="http://sreenivas.ramaswamy.googlepages.com/AdvancedDataGridColumnNested.as"&gt;ADGColumnNested&lt;/a&gt; and &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DGTest.mxml"&gt;test app&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3271932696508104190?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3271932696508104190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3271932696508104190' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3271932696508104190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3271932696508104190'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/01/extending-dgcolumn-and-adgcolumn-to.html' title='Extending DGColumn and ADGColumn to handle nested data fields.'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5636328623750437820</id><published>2008-01-22T04:34:00.000-08:00</published><updated>2008-01-22T22:05:16.427-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++ DLL'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='ExternalInterface'/><category scheme='http://www.blogger.com/atom/ns#' term='ActiveX'/><title type='text'>Flex talking to a ActiveX (using ExternalInterface)</title><content type='html'>&lt;p&gt;I keep seeing/getting request to know how Flex can communicate with a ActiveX control/DLL. So thought will post this sample in which calls were being exchanged between a Flex app and a ActiveX C++ DLL. You can find the source code &lt;a href="http://sreenivas.ramaswamy.googlepages.com/CallingCDLL.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The sample has two portions a flex app called CalledApp and a C++ DLL called CallingDLL. Load the CalledApp project in FlexBuilder and CallingDLL project is Visual Studio 2003 or later. Build the DLL and the Flex app. Run the Flex app and click on the button. When flex app calls the DLL function the DLL calls back the flex app.&lt;/p&gt;

&lt;p&gt;The key is to make the ActiveX DLL scriptable in IE. I went through the &lt;a href="http://sreeniblog.blogspot.com/2006/07/flex-2-released.html"&gt;trouble&lt;/a&gt; long back. The C++ code shows how to traverse the browser DOM to get access to the correct player and how to invoke functions exposed by the SWF.&lt;/p&gt;

&lt;p&gt;The Flex app uses &lt;a href="http://livedocs.adobe.com/flex/201/langref/flash/external/ExternalInterface.html"&gt;ExternalInterface&lt;/a&gt; to create a instance of the ActiveX and make calls to it.&lt;/p&gt;

&lt;p&gt;However the sample doesn't show passing arrays to the ActiveX which requires conversion of JavaScript Arrays to COM arrays. I am sure smart developers out there can figure out this :). &lt;/p&gt;

&lt;p&gt;If you are looking for a sample where in the SWF is loaded in the Flash player ActiveX control embedded in a Desktop application it can be found &lt;a href="http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00001975.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5636328623750437820?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5636328623750437820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5636328623750437820' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5636328623750437820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5636328623750437820'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/01/flex-talking-to-activex-using.html' title='Flex talking to a ActiveX (using ExternalInterface)'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-929455349970027315</id><published>2008-01-20T21:24:00.000-08:00</published><updated>2008-03-10T23:02:33.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='selectableRange'/><category scheme='http://www.blogger.com/atom/ns#' term='DateChooser'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Extending DateChooser.selectableRange to accept multiple values/ranges</title><content type='html'>Recently I came across the following requirement: Enable few disjoint dates in a DateChooser for user selection. The default DateChooser.selectableRange does not allow inserting of list of dates. It takes only a range and disables the rest.

&lt;p&gt;I copied and modified the Flex 2 DateChooser control to achive the new functionlity. The swc is available here http://sreenivas.ramaswamy.googlepages.com/FlexEx2.swc. &lt;/p&gt;

&lt;p&gt;I used this &lt;a href="http://sreenivas.ramaswamy.googlepages.com/testChooser.mxml"&gt;file&lt;/a&gt; to do the testing. I have done basic testing and it seems to work.&lt;/p&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="testChooser" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/testChooser.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/testChooser.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;Only few dates in Jan, Feb and March of 2008 are enabled and it restircts the navigation to only those months&lt;/p&gt;

&lt;p&gt;Currently I have made changes to only &lt;b&gt;Flex 2 DateChooser&lt;/b&gt;. I would be happy to fix any bugs found !&lt;/p&gt;

&lt;p&gt;Here are the Flex 3 files: &lt;a href="http://sreenivas.ramaswamy.googlepages.com/DateChooser.as"&gt;DateChooser&lt;/a&gt; and &lt;a href="http://sreenivas.ramaswamy.googlepages.com/CalendarLayout.as"&gt;CalenderLayout&lt;/a&gt;.

The project source to build a Flex3Ex SWC which contains the modified code for DateChooser and CalendarLayout can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/Flex3Ex.zip"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-929455349970027315?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/929455349970027315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=929455349970027315' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/929455349970027315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/929455349970027315'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2008/01/extending-datechooserselectablerange-to.html' title='Extending DateChooser.selectableRange to accept multiple values/ranges'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7757840482154295807</id><published>2007-12-21T22:26:00.000-08:00</published><updated>2007-12-21T23:15:19.098-08:00</updated><title type='text'>HierarchicalData from Flat XMLList data where nodes have parent info</title><content type='html'>This example shows how to make ADG display data in a Treeview or HierarchicalView when the source data is flat XMLList of nodes and each node has information about its parent node. Sample data is shown below:

&lt;p&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;p&gt;&amp;lt;tasks&gt;
&lt;p&gt;   &amp;lt;task id="1" name="Advanced Data Grid" type="parent" parentTask="0"/&gt; 
&lt;p&gt;   &amp;lt;task id="2" name="Collections" type="parent" parentTask="0"/&gt; 
&lt;p&gt;   &amp;lt;task id="3" name="OLAP" type="parent" parentTask="0"/&gt; 
&lt;p&gt;   
&lt;p&gt;   &amp;lt;task id="4" name="Treeview" type="parent" parentTask="1"/&gt; 
&lt;p&gt;   &amp;lt;task id="5" name="Column grouping" type="parent" parentTask="1"/&gt; 
&lt;p&gt;   &amp;lt;task id="6" name="IHierarhcicalData, IGroupingCollection" type="child" parentTask="2"/&gt; 
&lt;p&gt;   &amp;lt;task id="7" name="Concrete classes" type="child" parentTask="2"/&gt; 
&lt;p&gt;   &amp;lt;task id="8" name="OLAP Interfaces" type="child" parentTask="3"/&gt; 
&lt;p&gt;   &amp;lt;task id="9" name="OLAP DataGrid" type="child" parentTask="3"/&gt; 
&lt;p&gt;
&lt;p&gt;   &amp;lt;task id="10" name="Charts" type="parent" parentTask="0"/&gt; 
&lt;p&gt;
&lt;p&gt;   &amp;lt;task id="11" name="Region selection" type="child" parentTask="10"/&gt; 
&lt;p&gt;   &amp;lt;task id="12" name="Drag drop support" type="child" parentTask="10"/&gt; 
&lt;p&gt;
&lt;p&gt;   &amp;lt;task id="13" name="Tree items display" type="child" parentTask="4"/&gt; 
&lt;p&gt;   &amp;lt;task id="14" name="Drag drop support" type="child" parentTask="4"/&gt; 
&lt;p&gt;
&lt;p&gt;   &amp;lt;task id="15" name="Column spec" type="child" parentTask="5"/&gt; 
&lt;p&gt;   &amp;lt;task id="16" name="Column drag drop" type="child" parentTask="5"/&gt; 
&lt;p&gt;   &amp;lt;task id="16" name="Column Ressize" type="child" parentTask="5"/&gt; 
&lt;p&gt;  
&lt;p&gt; &amp;lt;/tasks&gt;
&lt;/p&gt;

&lt;p&gt; Here each node has a parentTask attribute which specifies the parent task id. The top most nodes have parent task attribute set to zero. The nodes can be in any order.&lt;/p&gt;

&lt;p&gt;We use the &lt;a href="http://sreenivas.ramaswamy.googlepages.com/FlatXMLToHD.zip"&gt;FlatXMLHD&lt;/a&gt; class which implements the IHierarchicalData interface to hide the XMLList parsing details. The result : &lt;/p&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="FlatSummary" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/FlatXMLToHD.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/FlatXMLToHD.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/FlatXMLToHD.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7757840482154295807?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7757840482154295807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7757840482154295807' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7757840482154295807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7757840482154295807'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/12/hierarchicaldata-from-flat-xmllist-data.html' title='HierarchicalData from Flat XMLList data where nodes have parent info'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-8592151122912965215</id><published>2007-12-07T04:01:00.000-08:00</published><updated>2007-12-07T04:37:43.817-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='HierarchicalData'/><category scheme='http://www.blogger.com/atom/ns#' term='Charts'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Displaying GroupingCollection/HierarchicalData in Charts with drill-down</title><content type='html'>This example shows how to use GroupingCollection/HierarchicalData as dataProvider to a Chart and how to support drill down and drill up navigation.

&lt;p&gt;Click on any item to drill-down and Ctrl+Click on any item to drill-up. The top chart uses HierarchicalData sample and the second chart uses GroupingCollection to generate a summary information from flat data. 

&lt;p&gt;Please note that all data is fictitious and I just cooked it up for the sample.

&lt;p&gt;To get access to parent and children collections a HierarchicalCollectionView is constructed using GC/HD as source. To display a drilled down view the children collection is set as charts dataProvider. For a drill-up operation the clicked items parent collection is set as dataProvider. &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="UserGrouping" width="308" height="907"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/ChartDrillDownUp.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/ChartDrillDownUp.swf" quality="high" bgcolor="#869ca7"
  width="308" height="907" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The source can be downloaded from &lt;a href="http://sreenivas.ramaswamy.googlepages.com/ChartDrillDownUp.zip"&gt;here&lt;/a&gt;.

&lt;p&gt;I have used the DrillDown, DrillUp effects from Ely's chart drill down &lt;a href="http://demo.quietlyscheming.com/drillDown/app.html"&gt;sample&lt;/a&gt; of XML data. The sample would have looked a bit dull without them. Thanks to Ely!.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-8592151122912965215?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/8592151122912965215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=8592151122912965215' title='24 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8592151122912965215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8592151122912965215'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/12/displaying-groupingcollectionhierarchic.html' title='Displaying GroupingCollection/HierarchicalData in Charts with drill-down'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2254934450563640575</id><published>2007-11-29T09:02:00.000-08:00</published><updated>2007-11-29T09:26:50.605-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ArrayCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='CollectionChangeEvent'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTPService'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Use ArrayCollection available in HTTPService result with caution</title><content type='html'>Please refer to &lt;a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&amp;threadid=1318678&amp;CFID=7322338&amp;CFTOKEN=6aafe1933943bfdd-8C5678D5-E6AC-0100-83A719FE64644FE5&amp;jsessionid=4830387760925a225e37"&gt;this&lt;/a&gt; and this &lt;a href="https://bugs.adobe.com/jira/browse/SDK-13247"&gt;bug report&lt;/a&gt; .

&lt;p&gt;Both of them speak about data editing/update not getting propagated properly through a ArrayCollection. The samples are using the ArrayCollection available from the HTTPService result directly. The HTTPService is creating the ArrayCollection first and then updating its source Array with items. The Array object doesn't dispatch any events when it is updated with new items. Due to this ArrayCollection has no way of adding event listeners for property changes to the items added later on. Hence the changes are detected only for the items present at the time of creation of ArrayCollection which happens to be 2 items. &lt;/p&gt;

&lt;p&gt;If one desire to use the HTTP result as dataProvider and expects data updates to get properly propagated they need to create a new ArrayCollection using the source of the default ArrayCollection present in the HTTP result. &lt;/p&gt;

&lt;p&gt; data_provider = new ArrayCollection(ArrayCollection(srv.lastResult.data.result).source); &lt;/p&gt;

&lt;p&gt;where srv is the HTTPService. If data_provider is already a ArrayCollection then we can just modify the source as follows &lt;/p&gt;

&lt;p&gt;data_provider.source = ArrayCollection(srv.lastResult.data.result).source;&lt;/p&gt;

This bug exists in Flex 2 and may not be fixed in Flex 3 as the current bug status is deffered!

The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/collectionChange.mxml"&gt;here&lt;/a&gt; and data getting loaded &lt;a href="http://sreenivas.ramaswamy.googlepages.com/change_data.xml"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2254934450563640575?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2254934450563640575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2254934450563640575' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2254934450563640575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2254934450563640575'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/use-arraycollection-available-in.html' title='Use ArrayCollection available in HTTPService result with caution'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5460848174195470543</id><published>2007-11-29T01:24:00.000-08:00</published><updated>2007-11-29T02:21:12.384-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingField'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Customizing grouping using GroupingField.groupingFunction in GroupingCollection</title><content type='html'>It is possible to generate custom groups using groupingFunction property of GroupingField. Take a look at the following sample. By choosing different options from "Choose age range" users can view the same data in different groups.

&lt;p&gt;The sample uses fictitious data of web site visitors by age and location. The example uses COUNT summary option to show how many visitors exist in each group.&lt;/p&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="UserGrouping" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/CustomGrouping.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/CustomGrouping.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

&lt;p&gt;The only thing to remember while writing a groupingFunction is that the return value should not change the sorting order being used for the dataField. Another way to put it is, the groupingFunction should return group names in a sorted order only. It shouldnot return group names in a random fashion.&lt;/p&gt;

&lt;p&gt;The source can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/CustomGrouping.mxml"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5460848174195470543?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5460848174195470543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5460848174195470543' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5460848174195470543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5460848174195470543'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/customizing-grouping-using.html' title='Customizing grouping using GroupingField.groupingFunction in GroupingCollection'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1168013795948742786</id><published>2007-11-19T21:53:00.000-08:00</published><updated>2007-11-19T22:43:51.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='XMLList'/><category scheme='http://www.blogger.com/atom/ns#' term='HierarchicalData'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>XMLList, HierarchicalData and AdvancedDataGrid</title><content type='html'>Using a XMLList as source for GroupingCollection or HierarchicalData is a bit tricky. The trickiness comes from the fact that there are two ways to specify values for a XML node. One as attributes and second as child nodes. Depending on which way values are specified we need to set properties differently to get the desired display in ADG.

For XMLList data type HierarchicalData treats the child nodes of a node to be children of the parent node by default. 

Specifying values as attributes:&lt;p&gt;

&lt;div style=”overflow: auto; height: 350px; width: 100%; background-color: #aaaaaa “&gt;
&lt;pre style=”border-top: 2px solid #aaaaaa; border-bottom: 2px solid #aaaaaa; width: 100%;font-family: ‘Courier New’,Courier,Fixed”&gt;

&amp;lt;Parent field1="valueA" field2="valueB" &amp;gt;
 &amp;lt;Child1 field1="value1" field2="value1b" /&amp;gt;
 &amp;lt;Child2 field1="value2" field2="value2b" /&amp;gt;
 &amp;lt;Child3 field1="value3" field2="value3b" /&amp;gt;
&amp;lt;/Parent&amp;gt;

&lt;/pre&gt;&lt;/div&gt;

Here Child1, Child2 and Child3 would be recognized as children of Parent node. 

Specifying values as sub nodes:&lt;p&gt;

&lt;div style=”overflow: auto; height: 350px; width: 100%; background-color: #aaaaaa “&gt;
&lt;pre style=”border-top: 2px solid #aaaaaa; border-bottom: 2px solid #aaaaaa; width: 100%;font-family: ‘Courier New’,Courier,Fixed”&gt;

&amp;lt;Parent&amp;gt;
    &amp;lt;field1&amp;gt;valueA&amp;lt;/field1&amp;gt;
    &amp;lt;field2&amp;gt;valueB&amp;lt;/field2&amp;gt;

   &amp;lt;subnodes&amp;gt;
    &amp;lt;Child1&amp;gt;
     &amp;lt;field1&amp;gt;value1&amp;lt;/field1&amp;gt;
     &amp;lt;field2&amp;gt;value1b&amp;lt;/field2&amp;gt;
    &amp;lt;/Child1&amp;gt;
    &amp;lt;Child2&amp;gt;
     &amp;lt;field1&amp;gt;value2&amp;lt;/field1&amp;gt;
     &amp;lt;field2&amp;gt;value2b&amp;lt;/field2&amp;gt;
    &amp;lt;/Child2&amp;gt;
    &amp;lt;Child3&amp;gt;
     &amp;lt;field1&amp;gt;value3&amp;lt;/field1&amp;gt;
     &amp;lt;field2&amp;gt;value3b&amp;lt;/field2&amp;gt;
    &amp;lt;/Child3&amp;gt;
   &amp;lt;/subnodes&amp;gt;
&amp;lt;/Parent&amp;gt;

&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If above data is set as source to HierarchicalData it would treat field1, field2 and subnodes as children of Parent node, which is not correct. To tell HierarchicalData to use only the nodes under subnodes as children set HierarchicalData.childrenField to "subnodes".

&lt;p&gt;The same rules apply when GroupingCollection (which is derived from HierarchicalData) is used to group flat data.

&lt;p&gt;Suppose following data is used as input to GroupingCollection and grouped on Region&lt;p&gt;

&lt;div style=”overflow: auto; height: 350px; width: 100%; background-color: #aaaaaa “&gt;
&lt;pre style=”border-top: 2px solid #aaaaaa; border-bottom: 2px solid #aaaaaa; width: 100%;font-family: ‘Courier New’,Courier,Fixed”&gt;

&amp;lt;Row&amp;gt;
    &amp;lt;Region&amp;gt;Southwest&amp;lt;/Region&amp;gt;
    &amp;lt;Territory&amp;gt;Arizona&amp;lt;/Territory&amp;gt;
    &amp;lt;Territory_Rep&amp;gt;Barbara Jennings&amp;lt;/Territory_Rep&amp;gt;
    &amp;lt;Actual&amp;gt;38865&amp;lt;/Actual&amp;gt;
    &amp;lt;Estimate&amp;gt;40000&amp;lt;/Estimate&amp;gt;
&amp;lt;/Row&amp;gt;

&amp;lt;Row&amp;gt;
    &amp;lt;Region&amp;gt;Southwest&amp;lt;/Region&amp;gt;
    &amp;lt;Territory&amp;gt;trials&amp;lt/Territory&amp;gt;
    &amp;lt;Territory_Rep&amp;gt;Dana Binn&amp;lt/Territory_Rep&amp;gt;
    &amp;lt;Actual&amp;gt;4000&amp;lt/Actual&amp;gt;
    &amp;lt;Estimate&amp;gt;5000&amp;lt/Estimate&amp;gt;
&amp;lt;/Row&amp;gt;
 
&amp;lt;Row&amp;gt;
    &amp;lt;Region&amp;gt;SouthEast&amp;lt;/Region&amp;gt;
    &amp;lt;Territory&amp;gt;Central California&amp;lt;/Territory&amp;gt;
    &amp;lt;Territory_Rep&amp;gt;Joe Smith&amp;lt;/Territory_Rep&amp;gt;
    &amp;lt;Actual&amp;gt;5000&amp;lt;/Actual&amp;gt;
    &amp;lt;Estimate&amp;gt;6000&amp;lt;/Estimate&amp;gt;
&amp;lt;/Row&amp;gt;

&amp;lt;Row&amp;gt;
   &amp;lt;Region&amp;gt;Southwest&amp;lt;/Region&amp;gt;
   &amp;lt;Territory&amp;gt;Nevada&amp;lt;/Territory&amp;gt;
   &amp;lt;Territory_Rep&amp;gt;Bethany Pittman&amp;lt;/Territory_Rep&amp;gt;
   &amp;lt;Actual&amp;gt;1000&amp;lt;/Actual&amp;gt;
   &amp;lt;Estimate&amp;gt;2000&amp;lt;/Estimate&amp;gt;
&amp;lt;/Row&amp;gt;

&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The result won't get displayed because the base HierarchicalData would treat &amp;ltRegion&amp;gt, &amp;ltTerritory&amp;gt etc nodes also as children of Row. To get proper display we need to set GroupingCollection.childrenField="abc" or some non existent node name. This would cause HierarchicalData to report that no children exist for the Row.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1168013795948742786?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1168013795948742786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1168013795948742786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1168013795948742786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1168013795948742786'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/xmllist-hierarchicaldata-and.html' title='XMLList, HierarchicalData and AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1767373701629073418</id><published>2007-11-09T00:51:00.000-08:00</published><updated>2007-11-09T01:03:53.474-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='smart column width'/><category scheme='http://www.blogger.com/atom/ns#' term='DataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Smart column width based on data displayed (Part One: No code yet)</title><content type='html'>From the poll conducted I find that many users want &lt;b&gt;Smart column width based on data displayed&lt;/b&gt; in DG/ADG.

&lt;p&gt;I hope people requesting this feature know that it is a CPU intensive process to go over all the items in the dataProvider to find out maximum width required for all the columns. If the number of visible columns is more it would take even more time to compute the values and layout the columns.&lt;/p&gt;

&lt;p&gt;If a labelFunction is being used at DG or DGColumn level and custom styles have been used on a column for fontSize for example, it complicates the computation even more.&lt;/p&gt;

&lt;p&gt;When the data is being paged from a server it is not possible to compute the smart width at all without requesting all the data from the server, which is never desirable.&lt;/p&gt;

&lt;p&gt;Keeping these things in mind I feel it makes sense to have a flag on individaul DGcolumn (apart from one on the DG itself) to control the computation of smart width. If the flag is true width is computed and false would use the normal way of determining the column width.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1767373701629073418?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1767373701629073418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1767373701629073418' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1767373701629073418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1767373701629073418'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/smart-column-width-based-on-data.html' title='Smart column width based on data displayed (Part One: No code yet)'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6414585030557021596</id><published>2007-11-08T22:40:00.000-08:00</published><updated>2007-11-09T08:27:12.315-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summary'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='Flat Data'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Generating summary for flat data using GroupingCollection</title><content type='html'>This example shows how GroupingCollection can be used to generate summary data for flat data and AdvancedDataGrid can be used to display the result.

&lt;p&gt;The trick (or dirty work around if you like to call it so) is to generate a single dummy group using a invalid grouping field. The summary we require is specified as usual using the SummaryRow and SummaryField.&lt;/p&gt;

&lt;p&gt;When this GroupingCollection is fed to ADG.dataProvider it would try to display in a tree view. By setting the HierarchicalCollectionView.showRoot flag to false to avoid displaying the single group parent.&lt;/p&gt;

&lt;p&gt;By specifying the default ADGItemRenderer as ADG.groupItemRenderer we can prevent the group icons from getting displayed.&lt;/p&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="FlatSummary" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/FlatSummary.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/FlatSummary.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

The source is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/FlatSummary.mxml"&gt;here&lt;/a&gt;.

&lt;p&gt;Please note I have not tested this example extensively. So some bug fixes may be required before it can be used in production.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6414585030557021596?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6414585030557021596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6414585030557021596' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6414585030557021596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6414585030557021596'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/generating-summary-for-flat-data-using.html' title='Generating summary for flat data using GroupingCollection'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6604273788953315734</id><published>2007-11-02T04:44:00.000-07:00</published><updated>2007-12-05T02:43:49.797-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='groupLabelFunction'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>Customizing Group label fields when using GroupingCollection</title><content type='html'>By using the ADG.groupLabelFunction property one can customize the group label displayed for the group nodes.

The following example shows how children count can be displayed as part of the group label when the group is closed.

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="CustomGrouping" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/CustomGrouping.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/CustomGrouping.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

The source can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/GroupCount.mxml"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6604273788953315734?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6604273788953315734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6604273788953315734' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6604273788953315734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6604273788953315734'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/11/customizing-group-label-fields-when.html' title='Customizing Group label fields when using GroupingCollection'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-8137233366859199196</id><published>2007-10-12T04:55:00.000-07:00</published><updated>2007-10-22T04:01:46.431-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Poll for current and new features in AdvancedDataGrid</title><content type='html'>I created three polls at the end of my blog. One to know how users are feelling about ADG in its current form, second what features of ADG in Flex 3 users are liking the most and third one to see what new features users would like to see in the next version of AdvancedDataGrid to make it more useful.

&lt;p&gt;Who knows you may be able to guide the future developement of ADG !&lt;/p&gt;

&lt;p&gt;Thanks in advance for giving your opinion!&lt;/p&gt;

&lt;p&gt;If you want to see more choices do leave a comment. I would add it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-8137233366859199196?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/8137233366859199196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=8137233366859199196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8137233366859199196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8137233366859199196'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/10/poll-for-current-and-new-features-in.html' title='Poll for current and new features in AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1702801258562292173</id><published>2007-10-11T05:56:00.000-07:00</published><updated>2008-02-27T20:47:01.138-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Async refresh of GroupingCollection</title><content type='html'>In Flex 3 Beta-2, GroupingCollection adds support for asychronous refresh. When we have large number of input rows or don't want to wait for the grouping to finish to see the results we can pass true to GroupingCollection.refresh(async:Boolean) and get to view the results as the grouped data is built. Users are allowed to interact with the shown information. Refresh can be even stopped by calling cancelRefresh. 

&lt;p&gt;I wrote a small app to test this. The app generates random data and displays it in AdvancedDataGrid(ADG) when "Populate ADG" is clicked. The number of data rows can be modified using the numeric stepper. A click on "Group" starts async refresh and ADG starts displaying the results immediately. Grouping can be cancelled any time using "Cancel Grouping". The three check boxes allow different combinations of grouping to be performed. &lt;/p&gt;

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 id="GCApp" width="520" height="440"
 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
 &lt;param name="movie" value="http://sreenivas.ramaswamy.googlepages.com/GCApp.swf" /&gt;
 &lt;param name="quality" value="high" /&gt;
 &lt;param name="bgcolor" value="#869ca7" /&gt;
 &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
 &lt;embed src="http://sreenivas.ramaswamy.googlepages.com/GCApp.swf" quality="high" bgcolor="#869ca7"
  width="520" height="440" name="GCApp" align="middle"
  play="true"
  loop="false"
  quality="high"
  allowScriptAccess="sameDomain"
  type="application/x-shockwave-flash"
  pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
 &lt;/embed&gt;
&lt;/object&gt;

Option to pause/resume a refresh is not available.

&lt;p&gt;The source is available &lt;a href="http://sreenivas.ramaswamy.googlepages.com/GCApp.mxml"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1702801258562292173?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1702801258562292173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1702801258562292173' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1702801258562292173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1702801258562292173'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/10/async-refresh-of-groupingcollection.html' title='Async refresh of GroupingCollection'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-3076372624335832970</id><published>2007-09-28T03:31:00.000-07:00</published><updated>2007-09-28T03:39:06.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='itemRenderers'/><category scheme='http://www.blogger.com/atom/ns#' term='Charts'/><title type='text'>Displaying charts in AdvancedDataGrid</title><content type='html'>Using charts as itemRenderers in DG and ADG is easy. Find the sample files &lt;a href="http://sreenivas.ramaswamy.googlepages.com/ADGChart.zip"&gt;here&lt;/a&gt;

&lt;a href="http://2.bp.blogspot.com/_sh8W7P3dJgY/RvzYuLjT6CI/AAAAAAAAAA8/UZZzOFPU15I/s1600-h/ADGChart.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_sh8W7P3dJgY/RvzYuLjT6CI/AAAAAAAAAA8/UZZzOFPU15I/s400/ADGChart.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5115201564672518178" /&gt;&lt;/a&gt;

The sample uses a LineChart as itemRenderer for the third column and a PieChart in the child area. The column-spanning option available through RendererProviders is used to make the PieChart occupy the whole row.

The sample shows use of HierarchicalData but even without that All chart types can be used as itemRenderes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-3076372624335832970?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/3076372624335832970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=3076372624335832970' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3076372624335832970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/3076372624335832970'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/09/displaying-charts-in-advanceddatagrid.html' title='Displaying charts in AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_sh8W7P3dJgY/RvzYuLjT6CI/AAAAAAAAAA8/UZZzOFPU15I/s72-c/ADGChart.jpg' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-4582226149723778292</id><published>2007-08-27T04:49:00.000-07:00</published><updated>2007-08-27T05:34:55.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Column Grouping'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>AdvancedDataGrid Multi level Column Grouping</title><content type='html'>AdvancedDataGrid supports column grouping. An example showing multiple level grouping is shown below.

&lt;a href="http://3.bp.blogspot.com/_sh8W7P3dJgY/RtLESf2d75I/AAAAAAAAAA0/oaFg9FUi-qE/s1600-h/ADGColumnGrouping.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_sh8W7P3dJgY/RtLESf2d75I/AAAAAAAAAA0/oaFg9FUi-qE/s400/ADGColumnGrouping.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5103357149830836114" /&gt;&lt;/a&gt;

&lt;a href="http://sreenivas.ramaswamy.googlepages.com/ADGColumnGrouping.mxml"&gt;Here&lt;/a&gt; is the mxml file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-4582226149723778292?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/4582226149723778292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=4582226149723778292' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4582226149723778292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/4582226149723778292'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/08/advanceddatagrid-multi-level-column.html' title='AdvancedDataGrid Multi level Column Grouping'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_sh8W7P3dJgY/RtLESf2d75I/AAAAAAAAAA0/oaFg9FUi-qE/s72-c/ADGColumnGrouping.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7958466441285906048</id><published>2007-07-31T20:30:00.000-07:00</published><updated>2007-08-01T22:05:59.430-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Header customization'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='styles'/><title type='text'>Customizing headers in DG/ADG</title><content type='html'>Customizing headers in DataGrid and AdvancedDataGrid (DG/ADG) is very easy. Just point the headerStyleName property available on these controls to any style declaration you want. The following image shows one such example where the header text is colored in blue and red. The second column text is center aligned. 


&lt;a href="http://2.bp.blogspot.com/_sh8W7P3dJgY/RrAALQt-VdI/AAAAAAAAAAs/zYbQm4nKGfc/s1600-h/headerStyles.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_sh8W7P3dJgY/RrAALQt-VdI/AAAAAAAAAAs/zYbQm4nKGfc/s400/headerStyles.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5093571372022388178" /&gt;&lt;/a&gt;


The important thing to notice here is that the headers are now styled differently than the column content. If the same styles were set on the column objects then the header as well as column content would have got same styles. headerStyleName allows customizing only the headers.

The headerStyleName is available on the control and the column object. Hence you can set the control.headerStyleName to customize all the headers and use the column.headerStyleName to customize individual headers.

A sample &lt;a href="http://sreenivas.ramaswamy.googlepages.com/HeaderStyles.mxml"&gt;mxml&lt;/a&gt; file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7958466441285906048?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7958466441285906048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7958466441285906048' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7958466441285906048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7958466441285906048'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/07/customizing-headers-in-dgadg.html' title='Customizing headers in DG/ADG'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_sh8W7P3dJgY/RrAALQt-VdI/AAAAAAAAAAs/zYbQm4nKGfc/s72-c/headerStyles.JPG' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7545320504900101854</id><published>2007-06-21T05:18:00.000-07:00</published><updated>2007-08-01T22:07:11.768-07:00</updated><title type='text'>Using public namespace explicitly</title><content type='html'>Having same function in two or more name spaces can cause the following compiler error when trying to access the function.

1000: Ambiguous reference to foo.

This error is easily generated when "using namespace &lt;space_name&gt;" has been included in the file instead of referring to the namespace explicitly. 

&lt;pre&gt;
myspace.as

package
{
  public namespace myspace = "http://myspace";
}

TestClass.as

package
{
import myspace;

public class TestClass
{

  public function foo():void
  {
 trace("Public foo is called");
  }

  myspace function foo():void
  {
 trace("MySpace foo is called");
  }

  private function fooPrivate():void
  {
 trace("Called private function");
  }

  protected function fooProtected():void
  {
 trace("Called protected function");
  }

  public function callFoo(t:TestClass):void
  {
        // call the private/protected members on the object.
 t.fooPrivate();
 t.fooProtected();
  }
}
}

testApp.mxml

&amp;lt?xml version="1.0" encoding="utf-8"?&gt;
&amp;ltmx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
 creationComplete="testFunc()"&gt;
&amp;ltmx:Script&gt;
 &amp;lt![CDATA[

use namespace myspace;

private function testFunc():void
{
   var test:TestClass = new TestClass;
   //public can be also used as namespace name to call the correct function.
   test.public::foo();

   // call the myspace namespace function
   test.myspace::foo();

   var test2:TestClass = new TestClass;
   // call the function to demonstrate that private/protected functions
   // can be called on test2 object.
   test.callFoo(test2);

}
]]&gt;
&amp;lt/mx:Script&gt;
&amp;lt/mx:Application&gt;
&lt;/pre&gt;

The above example also shows the possibility of calling private/protected functions on an object of the same class within the functions of the class. I don't think this is allowed in languages like C++.

Note: As Richard has commented it is alllowed in C++ too. I think it makes sense as friend functions can access private variables of objects member functions should be able to access them too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7545320504900101854?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7545320504900101854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7545320504900101854' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7545320504900101854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7545320504900101854'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/06/using-public-namespace-explicitly.html' title='Using public namespace explicitly'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-6392440776980611744</id><published>2007-06-19T23:11:00.000-07:00</published><updated>2007-06-19T23:17:55.396-07:00</updated><title type='text'>Summary customization in AdvancedDataGrid</title><content type='html'>ADG allows customization of Summary and Grouping with various callback functions and properties. One such property available on the SummaryField class is the label property which allows one to customize the property name used for the summary data. This example shows one such usage to skip displaying any estimate information at the leaf level but display a budget summary data at the Territory level.


&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_sh8W7P3dJgY/RnjGSUjno7I/AAAAAAAAAAk/yh2lW7EADEc/s1600-h/SummaryAtGroupLevel.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_sh8W7P3dJgY/RnjGSUjno7I/AAAAAAAAAAk/yh2lW7EADEc/s400/SummaryAtGroupLevel.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5078026597918286770" /&gt;&lt;/a&gt;

The mxml file is &lt;a href="http://sreenivas.ramaswamy.googlepages.com/SummaryAtGroupLevel.mxml"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-6392440776980611744?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/6392440776980611744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=6392440776980611744' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6392440776980611744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/6392440776980611744'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/06/summary-customization-in.html' title='Summary customization in AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_sh8W7P3dJgY/RnjGSUjno7I/AAAAAAAAAAk/yh2lW7EADEc/s72-c/SummaryAtGroupLevel.JPG' height='72' width='72'/><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-2925164274641790092</id><published>2007-06-14T22:32:00.000-07:00</published><updated>2007-06-14T22:37:36.723-07:00</updated><title type='text'>headerStyleName property of AdvancedDataGrid</title><content type='html'>In my previous post I said that I thought it was not possible to style the header independent of the column cells. I was wrong. I found out that AdvancedDataGrid has the headerStyleName property similar to DG which can be set and headers can be styles independently.

Using that and tweaking a little bit of code I could get the following look and feel which looks really nice!

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_sh8W7P3dJgY/RnIlh0jno6I/AAAAAAAAAAc/fBLFxt372LI/s1600-h/SummaryRollUpColumnGrouping-1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_sh8W7P3dJgY/RnIlh0jno6I/AAAAAAAAAAc/fBLFxt372LI/s320/SummaryRollUpColumnGrouping-1.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5076160992973923234" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-2925164274641790092?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/2925164274641790092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=2925164274641790092' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2925164274641790092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/2925164274641790092'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/06/headerstylename-property-of.html' title='headerStyleName property of AdvancedDataGrid'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_sh8W7P3dJgY/RnIlh0jno6I/AAAAAAAAAAc/fBLFxt372LI/s72-c/SummaryRollUpColumnGrouping-1.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-743684123443639518</id><published>2007-06-14T05:08:00.001-07:00</published><updated>2007-06-21T06:37:34.598-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summary'/><category scheme='http://www.blogger.com/atom/ns#' term='GroupingCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='Grouping'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><title type='text'>AdvancedDataGrid Summary with column grouping</title><content type='html'>I improved my previous &lt;a href="http://flexpearls.blogspot.com/2007/06/advanceddatagrid-summary-roll-up-sample.html"&gt;sample&lt;/a&gt; with column grouping getting the following look.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_sh8W7P3dJgY/RnEwFkjno5I/AAAAAAAAAAU/btjSlBVVPjo/s1600-h/SummaryRollUpColumnGrouping.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_sh8W7P3dJgY/RnEwFkjno5I/AAAAAAAAAAU/btjSlBVVPjo/s320/SummaryRollUpColumnGrouping.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5075891127293813650" /&gt;&lt;/a&gt;

The new MXML can be found &lt;a href="http://sreenivas.ramaswamy.googlepages.com/SummaryRollUpWithColumnGrouping.mxml"&gt;here&lt;/a&gt;.

One problem I immediately noticed is that one cannot horizontally center the headerText of the columns without centering the column cell text, this is specially a problem with first column. I filed a &lt;a href="https://bugs.adobe.com/jira/browse/FLEXDMV-939"&gt;request&lt;/a&gt; for this.

The headerText cannot be vertically centered either. However this has been already &lt;a href="https://bugs.adobe.com/jira/browse/FLEXDMV-841"&gt;reported&lt;/a&gt; requesting even more options.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-743684123443639518?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/743684123443639518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=743684123443639518' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/743684123443639518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/743684123443639518'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/06/advanceddatagrid-summary-with-column.html' title='AdvancedDataGrid Summary with column grouping'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_sh8W7P3dJgY/RnEwFkjno5I/AAAAAAAAAAU/btjSlBVVPjo/s72-c/SummaryRollUpColumnGrouping.JPG' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-8573992072455555454</id><published>2007-06-14T03:13:00.000-07:00</published><updated>2007-06-14T03:48:39.572-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summary'/><category scheme='http://www.blogger.com/atom/ns#' term='Moxie'/><category scheme='http://www.blogger.com/atom/ns#' term='AdvancedDataGrid'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>AdvancedDataGrid Summary roll up sample</title><content type='html'>Here is a sample application showing Summary roll up feature in AdvancedDataGrid and GroupingCollection.

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_sh8W7P3dJgY/RnEWeUjno4I/AAAAAAAAAAM/FQtDgKk2u3I/s1600-h/SummaryRollUp.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_sh8W7P3dJgY/RnEWeUjno4I/AAAAAAAAAAM/FQtDgKk2u3I/s320/SummaryRollUp.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5075862965193253762" /&gt;&lt;/a&gt;

The GroupingCollection takes flat data in the form of a ICollectionView object as input and generates a grouped collection based on the GroupingField information provided. The example shows grouping on the Region and Territory data fields.

Of-course don't forget to call the refresh method on the GroupingCollection to make the collection to generate the grouping.

If Summary is desired Summaries with SummaryRow and SummaryField information can be added to each GroupingField object. The SummaryRow has a summaryPlacement property which can take &lt;b&gt;multiple&lt;/b&gt; values as input from the possible values of group, first and last. I have used group to show the roll up of summary values.

SummaryField has a operation property which by default supports "SUM", "MIN", "MAX", "AVG" and "COUNT". 

ADGColumn has support for a formatter which can be used to format cell values using any Flex formatter. I have used currency formatter to place a $ symbol.

ADG and ADGColumn have a style function property which can be used to set style values on a particular cell based on its data content. The example uses this to change the font color to red.

Oh! ADG has loads of features. Check it &lt;a href="http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Advanced_DataGrid"&gt;out&lt;/a&gt;.

Before I forget &lt;a href="http://sreenivas.ramaswamy.googlepages.com/SummaryRollUp.mxml"&gt;here&lt;/a&gt; is MXML file for the sample.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-8573992072455555454?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/8573992072455555454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=8573992072455555454' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8573992072455555454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8573992072455555454'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/06/advanceddatagrid-summary-roll-up-sample.html' title='AdvancedDataGrid Summary roll up sample'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_sh8W7P3dJgY/RnEWeUjno4I/AAAAAAAAAAM/FQtDgKk2u3I/s72-c/SummaryRollUp.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-1518702994656028160</id><published>2007-05-25T06:41:00.000-07:00</published><updated>2007-05-29T22:49:52.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PDF'/><category scheme='http://www.blogger.com/atom/ns#' term='Print'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Printing'/><title type='text'>Flex components to PDF</title><content type='html'>Printing Flex components or converting them to PDF is very easy. Here is a sample code which shows how to print a column chart. If you want to generate a PDF you need to have ADOBE PDF printer driver installed on the machine. In the print dialog instead choosing a printer you can choose ADOBE PDF printer listed and you get a PDF as output.

Sunil has more info about printing charts with data tips &lt;a href="http://sunban.wordpress.com/"&gt;here.&lt;/a&gt;

More about Flex Printing can be found &lt;a href="http://www.darronschall.com/weblog/archives/000193.cfm"&gt;here&lt;/a&gt; too.

&lt;a href="http://sreenivas.ramaswamy.googlepages.com/ChartToPDF.mxml"&gt;ChartToPDF.mxml&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-1518702994656028160?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/1518702994656028160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=1518702994656028160' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1518702994656028160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/1518702994656028160'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/05/flex-components-to-pdf.html' title='Flex components to PDF'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7760905735219134066</id><published>2007-03-14T06:15:00.000-07:00</published><updated>2007-03-15T01:10:48.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Multiple sets of visual children have been specified for this component.'/><title type='text'>Specifying children for derived MXML containers can be done at only one place</title><content type='html'>Error: Multiple sets of visual children have been specified for this component (component definition and component instance).

is thrown by Flex when developers attempt to define children at two different places for a container. Suppose we have MyFirstBox extending HBox as follows:

MySecondHBox.mxml

&lt;code&gt;
&lt;pre&gt;
   &amp;lt;mx:HBox mx="http://www.adobe.com/2006/mxml"&amp;gt;

      &amp;lt;mx:Button label="Button in declaration"/&amp;gt;
 
   &amp;lt;/mx:HBox&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

And we are trying to use MyFirstBox in another container like this

&lt;code&gt;
&lt;pre&gt;
  &amp;lt;Application&amp;gt;

    &amp;lt;MyFirsthBox&amp;gt;

      &amp;lt;mx:Button label="Button in Instance" /&amp;gt;

    &amp;lt;/MyFirstHBox&amp;gt;
  &amp;lt;/Application&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

Flex throws the exception because it finds that in the declaration as well as in the instance inside the application child buttons are being added.

This may be very easy to catch but where it bites is when we are trying to create a hierarchy of MXML components. Suppose we try to create a second HBox derived from MyFirstBox as follows

MySecondHBox.mxml

&lt;code&gt;
&lt;pre&gt;
  &amp;lt;MyFirstHBox xmlns="*" mx="http://www.adobe.com/2006/mxml"&amp;gt;

    &amp;lt;mx:Button label="Button in derived comp" /&amp;gt;


  &amp;lt;/MyFirstHBox&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

This is also not allowed as it falls under the same category and Flex throws the same exception. The workaround is to define children only in the leaf derived class.

Any solution?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7760905735219134066?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7760905735219134066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7760905735219134066' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7760905735219134066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7760905735219134066'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/03/specifying-children-for-derived-mxml.html' title='Specifying children for derived MXML containers can be done at only one place'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-7449958603206086645</id><published>2007-03-04T00:56:00.000-08:00</published><updated>2007-03-04T01:02:10.287-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VerifyError: Error #1030: Stack depth is unbalanced.'/><title type='text'>Coding problem in ActionScript</title><content type='html'>The following code generates a VerifyError when getInstance is called.

&lt;FONT color="red"&gt;VerifyError: Error #1030: Stack depth is unbalanced. 0 != 1.
   at SingletonTest$iinit() &lt;/FONT&gt;

 public class SingletonTest
 {
 private static var s_singleton:SingletonTest = null;
 public static function getInstance():SingletonTest
 {
  if (s_singleton == null)
   s_singleton = new SingletonTest(); //Fails at this line.
  return s_singleton;
 }
 public function SingletonTest()
 {
  super;
  try
  {
  }
  catch (e:Error)
  {
  }
 }
 }

Can you guess why?

&lt;span style="font-weight:bold;"&gt;The reason is the super call in the constructor which is missing the () !&lt;/span&gt;

Why wouldn't the compiler throw a error or ignore the statement?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-7449958603206086645?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/7449958603206086645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=7449958603206086645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7449958603206086645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/7449958603206086645'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/03/coding-problem-in-actionscript.html' title='Coding problem in ActionScript'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-5874514610129322736</id><published>2007-02-23T04:50:00.000-08:00</published><updated>2007-02-23T05:00:04.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ResourceBundle'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Compiler error'/><category scheme='http://www.blogger.com/atom/ns#' term='Unable to resolve a class for ResourceBundle'/><title type='text'>ResourceBundle Tag should match the name of properties file</title><content type='html'>&lt;p style="font-weight: bold;"&gt;&lt;span style="font-size:85%;"&gt;Unable to resolve a class for ResourceBundle: xxx.&lt;/span&gt;
&lt;/p&gt;is a very frequent error thrown by the MXML compiler when we are including different SWCs as libraries or trying to create a new resource by creating a new yyy.properties file and trying to use it in a AS class file by using the [ResourceBundle] tag.

The key is to remember that the name given in the tag should match the properties file name.  So for yyy.properties file one should use [ResourceBundle("yyy")] .

Even if you are using a zzz_rb.swc file containing the resources and you want to use the yyy resource present in the swc we should use the [ResourceBundle("yyy")] tag in AS file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-5874514610129322736?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/5874514610129322736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=5874514610129322736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5874514610129322736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/5874514610129322736'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/02/resourcebundle-tag-should-match-name-of.html' title='ResourceBundle Tag should match the name of properties file'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1245414118611676168.post-8401700113669385231</id><published>2007-02-17T00:22:00.000-08:00</published><updated>2007-02-23T04:58:49.951-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>About Flex</title><content type='html'>I joined Macromedia (now Adobe) in 2005 July after spending more than 7 years in Tata Elxsi.

I opted to switch from Maya, 3D Graphics, C++ programming to Flex, ActionScript and Player.

After learning about blogging from Manish and reading blogs from Ely, Kevin Lynch, Raghu and various other people I also wanted blog separately on Flex but never thought my knowledge enough to enough to write one.

After a year or so I am feeling that I could put together a blog with lot of "pearls" I keep picking up from the DL-Flex Questions mailing list so that including myself anyone can make use of these.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1245414118611676168-8401700113669385231?l=flexpearls.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flexpearls.blogspot.com/feeds/8401700113669385231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1245414118611676168&amp;postID=8401700113669385231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8401700113669385231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1245414118611676168/posts/default/8401700113669385231'/><link rel='alternate' type='text/html' href='http://flexpearls.blogspot.com/2007/02/about-flex.html' title='About Flex'/><author><name>Sreenivas</name><uri>http://www.blogger.com/profile/17636694169757371801</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
