简体   繁体   English

Flex:如何为自定义组件创建各种浮动通知消息?

[英]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". 我有一个针对日期和时间的基于TextInput的自定义组件,对“范围内”有某些限制。 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. 当用户在valueCommit上输入日期时,我希望能够向用户显示一个悬停的通知,以通知/警告他们该日期超出了可接受的范围。

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: 您将要检查使用带有errorString的验证器:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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