ValidationSummary component in Flex Framework
Is there any component that does handle validation error开发者_运维问答s similarly to ASP.NET's ValidationSummary control in flex? (See screenshot)
alt text http://i.msdn.microsoft.com/ms972961.pdc_userinput_fig2(en-us,MSDN.10).gif
Component should really only display all the errors for the validator it watches.
I'm convinced I already used it but I was unable to find it anywhere in the doc.
There is no component in Flex specifically designed to show a collection of all the validation errors in a form. Some built-in components have support for validation error indicators. TextInput, for instance, can display a red border with an error tooltip that appears on mouse roll over.
Flex Validators work a bit differently than this but check out the Validator Samples in Tour de Flex.
Well, I achieved the results I was expecting with a bit of work.
Sharing in the event that somebody has the same needs that I had ;-):
- Made a component that overrides validationResultHandler and manages validation errors
- Made sure that all the validators that had to be shown in the component had their listener property set to the component's instance
And thats pretty much it.
<my:ValidationView id="vv" />
<mx:StringValidator listener="{vv}" ... />
<mx:Validator listener="{vv}" ... />
精彩评论