4 Replies Latest reply on Nov 6, 2009 7:29 AM by ScottBoring

    Validation Results from ValidationGroup


      I am an architect for a very large flex project at the ActiveNetwork. I am considering using the ValidationGroup as part of our process for validation. I like the concept grouping validators including nested groups. I don't see how to get the validation results after validating the group though? I think this is an important feature that the standard validator class provides with validateAll() which returns the validation results. I'd like to see a similar feature on the ValidationGroup that validate all and returns the results which I can then display to the user.


      Is there currently a way to do this with ValidationGroup? Can this be added if it is not there?

        • 1. Re: Validation Results from ValidationGroup
          Alex Uhlmann Level 3

          Hi Scott,

          have you checked out the samples in the ValidationTest project? We currently don't propagate the ValidationResultEvent objects but we do store invalid Validator objects in the currently private invalid property. For what use case where you thinking about using the result objects?



          • 2. Re: Validation Results from ValidationGroup
            ScottBoring Level 1

            The use case is validating a form upon a user gesture.


            For instance: Let's say we have a simple form that collects some basic user data. When the user clicks the submit button I want to validate all of the fields in the form and notify the user of any and all validation results. I want to display in a popup information like: "First name is required", "Last name is required", etc...


            To do this I need the validation results from each validator.

            • 3. Re: Validation Results from ValidationGroup
              Alex Uhlmann Level 3

              OK, I understand. Thanks for the info. For your specific use case I've just comitted a new version to trunk that adds a collection of invalid Validators to the ValidationGroupEvent. Let me know if that satisfies your use case. Note, no guarantees that this will end up in the release version of Validation. I'm not sure if that's the best way to implement this feature yet.


              As an additional note: the user experience you describe with displaying error messages outside the context of the source of the error (a popup) reminds me more on thin client UIs that sometimes didn't have another straightforward technical way to display validation. I think a standard validation behaviour in Flex is to let the Flex controls display the error directly via errorStrings. The samles in the ValidationTest library show this behaviour. Would that not work for you?

              • 4. Re: Validation Results from ValidationGroup
                ScottBoring Level 1

                Thanks for considering my needs and adding the capability.


                In my opinion and typically the opinion of the Business Analysts that I work with; the standard validation behavior is not enough. I think the user needs a more identifiable mechanism that an error on their part occurred. I'm not a big fan of pop ups but I think somewhere a message needs to be displayed with detailed results.