HTML/CSS Service

Flex Using Data Binding to Configure Validators

Category: Flex Examples, flex tutorials    |    2,122 views

User input might also define the properties of the validator. In the following example, you let the user set the minimum and maximum values of a NumberValidator:

Code Samples:

<?xml version=”1.0″?>

<!– validators\ConfigWithBinding.mxml –>

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”>

<mx:NumberValidator source=”{inputA}” property=”text” minValue=”{Number(inputMin.text)}”

maxValue=”{Number(inputMax.text)}”/>

<mx:TextInput id=”inputA”/>

<mx:TextInput id=”inputMin” text=”1″/>

<mx:TextInput id=”inputMax” text=”10″/>

</mx:Application>

In this example, you use data binding to configure the properties of the validators. 

Share/Save/Bookmark

1 Star2 Stars (+1)

Tags: , ,

1 response so far!

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word