Fix regression issue. Turns out LabelUtil.itemToLabel has side effects and text 
was not updated on control unless called


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

Branch: refs/heads/develop
Commit: 4523974603953af1e042917f0098049dd290ffb2
Parents: d7fdb19
Author: Justin Mclean <[email protected]>
Authored: Tue Jan 10 19:28:19 2017 +1100
Committer: Justin Mclean <[email protected]>
Committed: Tue Jan 10 19:28:19 2017 +1100

----------------------------------------------------------------------
 .../projects/spark/src/spark/components/DropDownList.as | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/45239746/frameworks/projects/spark/src/spark/components/DropDownList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/DropDownList.as 
b/frameworks/projects/spark/src/spark/components/DropDownList.as
index e4dbd96..b6dfa01 100644
--- a/frameworks/projects/spark/src/spark/components/DropDownList.as
+++ b/frameworks/projects/spark/src/spark/components/DropDownList.as
@@ -367,11 +367,13 @@ public class DropDownList extends DropDownListBase
     {
         if (labelDisplay)
         {
-            if (displayItem == undefined)
-                displayItem = selectedItem;
-            else
-                labelDisplay.text = displayItem != null ? 
LabelUtil.itemToLabel(displayItem, labelField, labelFunction) : prompt;
-        }
+              if (displayItem == undefined)
+                  displayItem = selectedItem;
+              if (displayItem != null && displayItem != undefined)
+                  labelDisplay.text = LabelUtil.itemToLabel(displayItem, 
labelField, labelFunction);
+              else
+                  labelDisplay.text = prompt;
+               }
     }
 }
 }
\ No newline at end of file

Reply via email to