Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Section 2: Building User Interaction > Debugging - Pg. 111

Building user interaction 111 Here we have provided two constraints on the length and their respective error message. If we enter a nonvalid string we can see the effect of validation, as shown in Figure 2.10. A more common example is the following, where validation is made upon the click of a button. To trigger the validation effect you have to focus out the component (e.g., via a tab press). <fx:Declarations> <mx:StringValidator source="{myTextInput}" property="text" tooShortError="This string is too short. Minimum allowed length is 4. " tooLongError="This string is too long. Maximum allowed length is 10." minLength="4" maxLength="10"å trigger="{myButton}" triggerEvent="click" Figure 2.10 datagroup with custom item renderers.