Updated Branches:
  refs/heads/develop 566fd846a -> 17cf4ace2

FLEX-25906 clear selected item when data provider changes


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/5b087052
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/5b087052
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/5b087052

Branch: refs/heads/develop
Commit: 5b087052817bc179c710ac64f8012b1938a7b7ba
Parents: 566fd84
Author: Justin Mclean <jmcl...@apache.org>
Authored: Thu Sep 12 14:38:35 2013 +1000
Committer: Justin Mclean <jmcl...@apache.org>
Committed: Thu Sep 12 14:38:35 2013 +1000

----------------------------------------------------------------------
 .../spark/src/spark/components/ComboBox.as      | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/5b087052/frameworks/projects/spark/src/spark/components/ComboBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/ComboBox.as 
b/frameworks/projects/spark/src/spark/components/ComboBox.as
index 559b0bf..d7ab5c7 100644
--- a/frameworks/projects/spark/src/spark/components/ComboBox.as
+++ b/frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -35,6 +35,7 @@ import flashx.textLayout.operations.DeleteTextOperation;
 import flashx.textLayout.operations.FlowOperation;
 import flashx.textLayout.operations.InsertTextOperation;
 
+import mx.collections.IList;
 import mx.core.IIMESupport;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
@@ -327,6 +328,26 @@ public class ComboBox extends DropDownListBase implements 
IIMESupport
      */ 
     public var itemMatchingFunction:Function = null;     
     
+       
+       //----------------------------------
+       //  dataProvider
+       //----------------------------------
+       
+       [Inspectable(category="Data")]
+       
+       /**
+        *  @private
+        *  Update the label if the dataProvider has changed
+        */
+       override public function set dataProvider(value:IList):void
+       {   
+               if (dataProvider === value)
+                       return;
+               
+               selectedItem = null;
+               super.dataProvider = value;
+       }
+
     
//--------------------------------------------------------------------------
     //  labelToItemFunction
     
//--------------------------------------------------------------------------

Reply via email to