My approach to the grouping of Validators is specific to Forms. I created a Advanced Form that checks for validators on the page and provides an update to date "isValid" bindable property.
Read more here: http://renaun.com/blog/2006/08/23/88/ Renaun http://renaun.com/blog/ --- In [email protected], Luis Eduardo <[EMAIL PROTECTED]> wrote: > > > > i was thinking on one ValidatorManager component that take care of a > group of validators more easy and blackboxed. > is there something like this? > how u guys resolved this? > > my idea is something like this: > > <mx:ValidatorManager id="theJudge"/> > > <mx:StringValidator id="valString1" ...blablabla... /> > <mx:DateValidator id="valString2" ...blablabla... /> > <mx:EmailValidator id="valString3" ...blablabla... /> > > and on the codes (probably on init() ) we make something like this: > > theJudge.addValidator( valString1 ); > theJudge.addValidator( valString2 ); > theJudge.addValidator( valString3 ); > > at any point of the code we want test for all fields are valid we just > could do: > > theJudge.validateAll() -> to return a array of invalids validators > like the function listed here ( > http://livedocs.macromedia.com/flex/2/langref/mx/validators/Validator.html ) > > or perhaps a getter inside the judge that performs this to us and just > answer the question "is there some punk out there?" and return just true > and false like this: > > if ( theJudge.allValid ) { > gogogo() > } > > what u guys think of this? there are a better approach? > > waiting your replay, > > Luís Eduardo. > > P.S. i tryed the follow code: > > <mx:Validator id="mainVal"/> > <mx:array id="valarray"> > <mx:StringValidator id="valString1" ...blablabla... /> > <mx:DateValidator id="valString2" ...blablabla... /> > <mx:EmailValidator id="valString3" ...blablabla... /> > </mx:array> > > and then on the codes: > > mainVal.validateAll(valarray) like the docs said i could do but... it > appear that this function do not exists "validateAll". > > > > > > > > _______________________________________________________ > Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas ! > http://br.answers.yahoo.com/ > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcomponents/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcomponents/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
