1 Reply Latest reply on Feb 27, 2011 11:01 AM by Wrataxas

    binding to the enabled property of a mx:button?

    mumcs01 Level 1

      I have this button:

       

      <mx:Button label="Edit Static" id="btnEditStatic" enabled="{ parentDocument.staticDataGrid.selectedIndex != -1 }" click="addaStatic(event,staticDataGrid.selectedIndex)" />

       

      The problem is, I now need to base the enabled property off of 2 conditions :

      (parentDocument.staticDataGrid.selectedIndex != -1 && someBooleanVariable == true)

       

      what is the best way of going about this in a binding situation. If either of these conditions above fail, I want to set enabled in the btnEditStatic to false.

       

      I tried calling a function in the binding expresson but it would never return false when one of the conditions went false. I'm sure this involves explicitly calling some binding action following the function test? Just just don't know what