0 Replies Latest reply on Nov 11, 2009 10:43 AM by rfrishbe

    [svn:fx-trunk] 11660: Change IItemRendererOwner?\226?\128? \153s updateRenderer() method definition to:

    rfrishbe

      Revision: 11660

      Author:   rfrishbe@adobe.com

      Date:     2009-11-11 10:42:54 -0800 (Wed, 11 Nov 2009)

       

      Log Message:

      ***********

      Change IItemRendererOwner?\226?\128?\153s updateRenderer() method definition to:

       

      /**

       

      • Updates the renderer for re-use. This first prepares the item

       

      • renderer for re-use by clearing out any stale properties

       

      • as well as updating it with new properties.

       

       

      • <p>The last thing this method should do is set the data property

       

      • on the renderer.</p>   

      *

       

      • @param renderer The item renderer.

       

      • @param itemIndex The index of the data in the data provider

       

      • @param data The data object this item renderer is representing

       

      •  

       

      • @langversion 3.0

       

      • @playerversion Flash 10

       

      • @playerversion AIR 1.5

       

      • @productversion Flex 4

      */

      function updateRenderer(renderer:IVisualElement, itemIndex:int, data:Object):void; 

       

      Before, it only took one parameter, the renderer.  Now it takes 3. 

       

      The reason for this change is to make the code a little cleaner in terms of the separation between DataGroup and List.  Now DataGroup won?\226?\128?\153t do any work if the mx_internal _rendererUpdateDelegate is set.  If it is set (to a List for instance), then _rendererUpdateDelegate.updateRenderer(renderer, itemIndex, data) will be called.  This makes the updateRenderer() pass more clear because it?\226?\128?\153s all done in the rendererUpdateDelegate (rather than splitting it in DataGroup and ListBase).  It also makes it easier to get the ordering of properties correctly as we want the ?\226?\128?\156data?\226?\128?\157 property to be the last set property as part of the ?\226?\128?\156item renderer contract?\226?\128?\157.

       

      As part of this change, DataGroup is the default _rendererUpdateDelegate, and because of this it now implements IItemRendererOwner.  The only other method on IItemRendererOwner besides updateRenderer() is itemToLabel().  DataGroup already had a private itemToLabel() method, so I?\226?\128?\153m just making it public.

       

      Also, I'm making label and itemIndex bindable to the "dataChange" event now.

       

      QE notes: Please test that the data property is the last thing set

      Doc notes: You could update the documentation around item renderers to mention that the data property should be the last thing set.

      Bugs: SDK-19870, SDK-24086

      Reviewer: Deepa

      Tests run: checkintest, mustella list, listdragdrop, dropdownlist, combobox, buttonbar

      Is noteworthy for integration: Yes

       

      Ticket Links:

      ************

          http://bugs.adobe.com/jira/browse/SDK-19870

          http://bugs.adobe.com/jira/browse/SDK-24086

       

      Modified Paths:

      **************

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/IItemRendererOwner.as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer .as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as

          flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListItemDrag Proxy.as