      */
     override protected function commitProperties():void
     {
+    	if (dataProviderChanged && !popUpMenu)
+    	{
+    		// In general we shouldn't create the popUp until
+	        // they are actually popped up. However, in this case
+	        // the initial label, icon and action on the main button's 
+	        // click are to be borrowed from the popped menu. 
+	        // Moreover since PopUpMenuButton doesn't expose selectedIndex
+	        // selectedItem etc., one should be able to access them
+	        // prior to popping up the menu.        
+	        getPopUp();
+    	}
+    	
         if (_showRootChanged)
         {
             _showRootChanged = false;

    {
        if (popUpMenu)
            return Menu(popUpMenu).dataProvider;
        return null;
    }

    /**

        if (!popUpMenu || !super.popUp)
        {
            popUpMenu = new Menu();
            popUpMenu.iconField = _iconField;
            popUpMenu.iconFunction = _iconFunction;
            popUpMenu.labelField = _labelField;
            popUpMenu.labelFunction = _labelFunction;
            popUpMenu.showRoot = _showRoot;
