Flex Custom Validation and ToolTips

Development, Flex June 10th, 2008

On my current project at work I have to do a lot of custom validation. I wanted to figure out the easiest way to alert the user of errors without creating annoying pop-ups. After messing around with the ToolTipManager for a little while, which will allow you to customize tool tips. I still hadn’t found the “set and forget” solution I was looking for.

A little more digging around I found that every UIComponent has an errorString property. So to create an error tooltip, and have the framework manager manage it, all I had to do was something like this:

//Create an error tooltip for a TextInput.
myInput.errorString = "This field is required.";

When the user mouses over the input box with the error text set this is what they see:

tooltip

Leave a Reply