3 Replies Latest reply on Aug 23, 2009 2:06 PM by jimmyoneshot

    Changing an images icon to grayscale or Color when it is disabled/enabled

    jimmyoneshot Level 1

      I have a button in my app that is set to only be enables when a tilelist (profile1EntertainmentAddLinksTilelist) has at least 1 item in it. I have some text but also a coloured icon in this button.

       

      I currently have 2 code functions "convertToGrayscale()" which converts components to grayscale and "convertToColor()" which converts components to colour.

       

      What I want is so that when this button is enabled the convertToColor would be applied to it yet when it is disabled convertToGrayscale would be applied to it.

       

      I know there is an 'enabled' property within buttons but there doesn't be a basic 'disabled' property.

       

      Another problem is within my button I already have an enabled property so that when the tilelist has an item in it, only then is it enabled. Is it possible to add the convertToColor function into the enabled property so that it is enabled when the tilelist has more than 1 item in it the button is enabled AND it converts to colour? This is the bit I'm struggling with.

       

      enabled="{profile1EntertainmentAddLinksTilelist.selectedItem}"