Merge pull request #43 from stevage/voltage-tweaks
[potlatch2.git] / net / systemeD / potlatch2 / RelationSelectPanel.mxml
index a3af4dc4876dae28cdd0975e4e54716df077c4f0..00b0bd15dee84f73426bc4e4ef9df85333299496 100644 (file)
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <mx:TitleWindow
-    xmlns:mx="http://www.adobe.com/2006/mxml"
+    xmlns:fx="http://ns.adobe.com/mxml/2009"
+    xmlns:mx="library://ns.adobe.com/flex/mx"
     xmlns:potlatch2="net.systemeD.potlatch2.*"
     title="Select Relation" width="350" height="400"
     showCloseButton="true" close="PopUpManager.removePopUp(this);">
 
-    <mx:Script><![CDATA[
+    <fx:Script><![CDATA[
         import net.systemeD.halcyon.*;
         import net.systemeD.halcyon.connection.*;
         import net.systemeD.potlatch2.*;
                        panel.setEntity(entity);
                        PopUpManager.centerPopUp(panel);
                }
+               
+               public function updateSelectButton():void {
+                       selectButton.enabled=relationSelector.selectedItems.length>0;
+               }
         
-    ]]></mx:Script> 
+    ]]></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>