Have you tried calling either textArea.invalidateProperties() or textArea.invalidateDisplayList()? Im pretty sure that if you do that right after you set the error string, it will reset the border color
Doug On Thu, May 30, 2013 at 12:03 PM, ilikeflex <ilikef...@yahoo.com> wrote: > ** > > > Hi > > When errorString of the component is any value(ex 'Enter the value') then > the borderColor of the component changes to 'red'. But when you make the > errorString="" it does not change the borderColor of the component back for > the first time. > > It change when the control lose focus. > > How can we make the border color to original when using errorString="" for > the first time even the control does not loose focus. > > I have attached sample of the problem. > > Any pointers.. > > <?xml version="1.0" encoding="utf-8"?> > <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" > xmlns:s="library://ns.adobe.com/flex/spark" > xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> > <fx:Script> > <![CDATA[ > import mx.utils.StringUtil; > protected function textarea1_changeHandler(event:Event):void > { > // TODO Auto-generated method stub > if (StringUtil.trim((event.target as TextArea).text).length == 0) > { > (event.target as TextArea).errorString = 'Enter any value'; > } > else > { > (event.target as TextArea).errorString = ""; > } > } > ]]> > </fx:Script> > > <fx:Declarations> > <!-- Place non-visual elements (e.g., services, value objects) here --> > </fx:Declarations> > <s:layout> > <s:VerticalLayout/> > </s:layout> > > <mx:TextArea width="100" height="100" errorString="Enter any value" > change="textarea1_changeHandler(event)" > /> > <s:Button label="Hello World"/> > </s:Application> > > Thanks > ilikeflex > > >