确定视图中的哪个(自定义)组件当前具有焦点
我目前正在构建一个 Flex 4.5 移动项目,其中包括多个视图和自定义编写的 MXML 组件,这些组件可以动态合并到这些视图中。 如何确定哪个组件当前具有焦点,即已被用户点击激活? 其背景是主应用程序中的全局搜索功能。根据此搜索的结果,设置自定义组件中的字段。鉴于我不希望视图中的所有组件都侦听该搜索功能的结果,我必须检查哪个组件当前处于活动状态。 我正在尝试将选定的对象(搜索功能的结果)绑定到活动组件。
任何帮助将不胜感激。
干杯!
I'm currently building a Flex 4.5 mobile project including several views and custom written MXML components that can be incorporated dynamically into those views.
How do I determine which component currently has focus, namely has been activated by the user tapping on it?
The background for this is a global search function in the main application. Depending on the results of this search, fields in the custom components are set. Given that I don't want all components in a view to listen to the outcome of that search function, I have to check which one is currently active.
I'm trying to bind the selected object (the result from the search function) to the active component.
Any help would be much appreciated.
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 FocusManager.getFocus()。从概念上讲是这样的:
You can determine which component currently has focusing using the FocusManager.getFocus(). Conceptually something like this: