3 Replies Latest reply on Jun 19, 2010 4:59 PM by rashmin.d

    Flex Validation

    mxvx

      Hi

       

      Can someone tell me how to display the Flex validation errors below the field..  As of now I have the following validator, which is displaying the error message next to the control. I want that to be displayed beneath the control.

       

      <mx:StringValidator

       

      id="statStrVal" source="{stateTxt}" property="text" required="false" maxLength="5"/>

       

      Thanks & Regards

      mxvx

        • 1. Re: Flex Validation
          VRPDeveloper Level 3

          Just below your control specify lable make the visibility to false and also includeinlayout=false . Now in string validator add 1 more property "listener " and provide id of label to it. Then as soon as error comes it will show up to at listerner...

           

          <mx:Label visible="false" includeInLayout="false" id="error"/>

           

          <mx:StringValidator

           

          id="statStrVal" source="{stateTxt}" property="text" required="false" maxLength="5" listener="error" />

           

          Hope it will help!!!

          • 2. Re: Flex Validation
            rtalton Level 4

            If you want to position and style the error tip yourself, you can do so by using the ToolTipManager, which contains a style called errorTipBorderStyle. You can specify "errorTipRight", "errorTipAbove", or "errorTipBelow".

            • 3. Re: Flex Validation
              rashmin.d

              hi.......

               

              u want to display the Flex validation errors below the field, So, u have to customize Validator.. and in the valid and invalid event handler make ToolTip object using ToolTipManager.createToolTip(......) method, in that one of the argument is a position of popup error message,, so u can show where u want ..... n if u want to make different style in that so make .errorTip style and set that style to ToolTip object. (setStyle method....) 

               

              I hope this will help u..........