7 Replies Latest reply on Mar 22, 2010 10:16 AM by Alex Uhlmann

    Validantion Library 1.2 not working

    paob24

      Hi, I've updated the source of the validation library to version 1.2, and I discovered that the ValidatorSubscriber doesn't pass feedbacks of its state to the controller (basically you don't get the red focus if the field is not valid).

      You can see this behavior in the Sample3 Application file of the ValidationTest project, the same test was working fine in version 1.0 of the validation library

        • 1. Re: Validantion Library 1.2 not working
          Alex Uhlmann Level 3

          Hi,

           

          I can't reproduce that. If I update from trunk and run the Sample3.mxml I see the red error tips. The validation library 1.2 is working AFAIK. Are you sure you're using the latest trunk version on Flex SDK 3.3?

          • 2. Re: Validantion Library 1.2 not working
            paob24 Level 1

            Very strange, I went to the trunk and download the Validation e ValidationTest projects, than compiling using sdk 3.3 (tested also with 3.4, 3.5 and 4.0)

            and when I run Sample3 (svn revision 12842) couldn't get the error red focus on textInputs nor the error toolTip. Only the Form Validity box changed state after pressing the validate button.

            Sample1 and Sample2 are working fine.

            • 3. Re: Validantion Library 1.2 not working
              Alex Uhlmann Level 3

              I see now. I have had an older version of the validation library that worked. A recent change has broken a feature exposed through Sample3.mxml. We'll try to have this fixed ASAP. Thank for the pointer.

              • 4. Re: Validantion Library 1.2 not working
                paob24 Level 1

                Any news on this?

                • 5. Re: Validantion Library 1.2 not working
                  Anthony.R Level 2

                  I discovered the same issue and ended up fixing it myself and buildling a new Validation SWC from the SVN source.

                   

                  The fix is in the subscribeControl function in ValidatorGroupSubscriber.

                   

                  Change

                   

                              if( subscriber.listener && subscriber.listener is Array )
                              {
                                  subscriberListener = new ValidatorMultipleListeners( subscriber.listener as Array );       
                              }
                              else if( ! subscriber.listener is Array )
                              {
                                  subscriberListener = EventDispatcher( subscriber.listener );
                              }

                   

                  to

                   

                              if( subscriber.listener && subscriber.listener is Array )
                              {
                                  subscriberListener = new ValidatorMultipleListeners( subscriber.listener as Array );       
                              }
                              else if( !(subscriber.listener is Array) )
                              {
                                  subscriberListener = EventDispatcher( subscriber.listener );
                              }

                   

                  The subscriber listener wasn't getting set due to the missing brackets.

                   

                  Anthony

                  • 6. Re: Validantion Library 1.2 not working
                    paob24 Level 1

                    thanks penguinant

                    • 7. Re: Validantion Library 1.2 not working
                      Alex Uhlmann Level 3

                      Nice catch, Anthony! Thanks! I've just committed your fix to trunk.