|
I put your code into a sample application.
For me, it returned a validation error for any value that is put into the
TextInput object. I modified your code to get validation working, although
it is still ignoring the colName variable. I am not sure where that value
is being set or what it represents. How is this being used? Are you
using it as a custom implementation for a normal mx:TextInput object, or are
you using it as a custom cell renderer for a mx:DataGrid object? <?xml version="1.0"
encoding="utf-8"?> <mx:TextInput
xmlns:mx="http://www.macromedia.com/2003/mxml" > <mx:Script> <![CDATA[ function
customValidate() { var
validator = arguments[0][0].validator; if ( this.text != "test" ) validator.validationError(
null, "The value does not equal 'test'.", null ); } ]]> </mx:Script> <mx:Model
id="theModel">
<text>{text}</text> </mx:Model> <mx:Validator
field="theModel.text" validate="customValidate(arguments)"
listener="this" /> </mx:TextInput> -Andy _____________________________________ Andrew Trice Cynergy Systems, Inc. Email: [EMAIL PROTECTED] Office: 866-CYNERGY From: In
Flex 1.5, I am trying to create a PowerBuilder-esque column validator. I use a
custom TextInput field with a Validator so that when a user tabs out of a
column, the validation check is triggered. It appears to work for a simple
test, but I cannot get the validation error to trigger for other conditions.
Can anyone see a flaw or have another approach to share? Thanks. Here is
my custom TextInput with validator: <?xml
version="1.0" encoding="utf-8"?>
<mx:Validator
field="theModel.text" validate="customValidate( event )"
listener="this" /> <mx:Script>
</mx:TextInput>
Gary
Ault
|
Title: Custom dg validator
- [flexcoders] Custom dg validator Ault, Gary - BLS
- [flexcoders] Re: Custom dg validator Doug Lowder
- [flexcoders] Re: Custom dg validator bhaq1972
- RE: [flexcoders] Custom dg validator Andrew Trice
- [flexcoders] Re: Custom dg validator gault17
- [flexcoders] Re: Custom dg validator bhaq1972

