1 Reply Latest reply on Mar 16, 2010 12:58 AM by AdrianWiecek

    How to change the Validator's colour and thickness?

    megharajdeepak Level 1

      Hi,

       

      I am using a custom skin for my TextInput and a Combobox component. I am also validating these two using StringValidator and checking if they are empty. If validation fails, it generally shows up a thin red line on it's border. But since, I am using custom skin, this red thin border is not shown up at all. If I remove the skin in my css file, it works fine.

       

      I was wondering, it would be visible if I increase the thickness of that thin red line, when validation fails. How can I do so? Also, is there a way to change that colour from red to something else? Any overrrides for it pls?

       

      Screenshots for your reference:

       

      TexInput without the custom skin style, which works fine:

       

      ti1.JPG

      TextInput with the custom skin, whcih does not show up the thin red line:

       

      ti2.JPG

       

       

      ComboBox without custom skin, which works fine:

       

      cb1.png

       

       

      ComboBox with the custom skin, whcih does not show up the thin red line as the border:

       

      cb2.JPG

       

       

       

       

      -Deepak

        • 1. Re: How to change the Validator's colour and thickness?
          AdrianWiecek Level 3

          Hi,

           

          You can change color of error border by using errorColor style:

           

          <mx:ComboBox errorColor="#00FF00"/>

           

          or in actionscript using setStyle().

           

          If you want to use your own skin the error border will not be visible because it will be overriden by your skin

          I think you have at least 2 options to solve this problem:

           

          1. Extend ComboBox and create new style for "errorSkin", handle the style change and create errorSkin programmatically or in Illustrator/Photoshop.

          2. User Flex 4 and its new skinning capabilities.

           

          Regards,

          Adrian Wiecek