I'm using flex 2.0 and multiple validators in such a manner that I
enable/disable them depending on whether some text has been placed
in specific textInput controls. However, *most* of the time, the
validators are disabled but the screen still reflects that they are
operating (ie, the red boxes around the previously mentioned
textboxes). Seems like a bug to me. It has happened on the Number
Validator, the String validator to my knowledge, maybe more of
them.
Here's my mxml. I have 3 validators, one for each of the text
fields. When the user has changed the data in a textinput, I call a
function that re-evaluates all the validators to make sure they
should be enabled/disabled. I have verified that they are disabled
AND not required, but the screen still continues to show them as red
boxes. Any ideas on this problem would be welcome :)
Thanks!
Chad
-----------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel
title="Jockey Club Horse Finder"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:control="com.keeneland.salessystem.control.*"
creationComplete="onCreationComplete()"
horizontalAlign="left"
defaultButton="{searchButton}"
width="100%"
height="100%"
styleName="GeneralFormBackGround"
alpha="100">
<mx:Script source="SaleJockeyClubHorseFinderViewHelper.as"/>
<mx:Form width="100%" height="100%">
<mx:HBox horizontalAlign="center"
verticalAlign="middle">
<mx:FormItem label="Search For Horse: "
id="horseLabel">
<mx:TextInput id="horseName"
width="150" height="23" change="enableValidations()"/>
</mx:FormItem>
<mx:FormItem label="Dam: " id="damLabel">
<mx:TextInput id="damName"
width="150" height="23" change="enableValidations();"/>
</mx:FormItem>
<mx:FormItem label="YOB: " id="yobLabel">
<mx:TextInput id="yob" width="50"
height="23" change="enableValidations(); " focusOut="changeYOB()"/>
</mx:FormItem>
</mx:HBox>
<mx:HBox >
<mx:Button id="searchButton"
label="Search"
click="search()"
enabled="{CommonViewHelper.len(this.horseName.text)>0 ||
CommonViewHelper.len(this.damName.text)>0}"/>
<mx:Button id="clearButton"
label="Clear"
click="clearButtonClicked()"
enabled="true"/>
</mx:HBox>
<mx:VBox horizontalAlign="right" >
<mx:Label id="statusMessage"
text="" />
<mx:DataGrid id="horsesGrid"
width="550"
editable="false"
sortableColumns="true"
resizableColumns="true"
doubleClickEnabled="true"
doubleClick="okButtonClicked();"/>
</mx:VBox>
</mx:Form>
<!-- Button Section 1 -->
<mx:ControlBar width="100%" horizontalAlign="left">
<mx:Button id="okButton" label="OK"
click="okButtonClicked()" enabled="{horsesGrid.selectedIndex>-1?
true:false}"/>
<mx:Button id="cancelButton" label="Cancel"
click="closePopUp()"/>
</mx:ControlBar>
<mx:StringValidator id="validatorDamName"
property="text"
source="{damName}"
required="false"
enabled="false"
minLength="3"
tooShortError="{MessageModelLocator.getInstance
().msgTooShortError}"/>
<mx:StringValidator id="validatorHorseName"
property="text"
source="{horseName}"
enabled="false"
minLength="3"
required="false"
tooShortError="{MessageModelLocator.getInstance
().msgTooShortError}"/>
<mx:StringValidator id="validatorYOB"
property="text"
required="false"
source="{yob}"
enabled="false"
minLength="4"
tooShortError="{MessageModelLocator.getInstance
().msgTooShortError}" />
</mx:Panel>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/