Merge pull request #43 from stevage/voltage-tweaks
[potlatch2.git] / net / systemeD / potlatch2 / RelationSelectPanel.mxml
index e626f4f0311410cd2205419394b207950b7505aa..00b0bd15dee84f73426bc4e4ef9df85333299496 100644 (file)
                        panel.setEntity(entity);
                        PopUpManager.centerPopUp(panel);
                }
+               
+               public function updateSelectButton():void {
+                       selectButton.enabled=relationSelector.selectedItems.length>0;
+               }
         
     ]]></fx:Script>
     <mx:Text id="warning" text="" />
-    <mx:List width="100%" height="100%" id="relationSelector" verticalScrollPolicy="on" allowMultipleSelection="true" > 
+    <mx:List width="100%" height="100%" id="relationSelector" change="updateSelectButton();" verticalScrollPolicy="on" allowMultipleSelection="true" > 
     </mx:List>
     <mx:ControlBar>
       <mx:Button label="New Relation..." click="closeAndNewRelation();" styleName="titleWindowButton" />
       <mx:Button label="Load Relation..." click="closeAndLoadRelation();" styleName="titleWindowButton" />
       <mx:Spacer width="100%"/>
-      <mx:Button label="Select" click="updateEntityAndClose();" enabled="{relationSelector.selectedItems.length>0}" styleName="titleWindowButton" />
+      <mx:Button label="Select" id="selectButton" click="updateEntityAndClose();" enabled="false" styleName="titleWindowButton" />
     </mx:ControlBar>
 </mx:TitleWindow>