简体   繁体   中英

Flex: How to create a floating notification message of sorts for a custom component?

I have a custom TextInput-based component for date and time with certain restrictions on what's considered "within range". But it's still fine to insert dates that are outside the range.

When a user types in a date, on valueCommit, I'd like to be able to display a hovering notification to the user, to inform/warn them that the date is outside the accepted range.

I'm thinking of notifications ala the Validators, but I'd rather not use the Validator mechanism because it's really not validation, just notification. Something like a tooltip, but it will only appear if the user changed the value. Maybe an effect of some sort?

If anyone has any ideas or if anyone has done something like this, I'm all ears!

So I know you said you don't want to use validators, but at the same time, that sounds exactly like what you're describing. You're not validating the whole form though, just checking a field to make sure it confirms to some standard. You'll want to check out the use of validators with errorString:

http://livedocs.adobe.com/flex/3/html/help.html?content=validators_5.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM