Blackberry Java:点击后删除 ListField,奇怪的行为
我有一个使用 ListField 组件的应用程序。当在 ListField 中单击项目时,我从管理器中删除 ListField 并添加其他管理器。
我的问题是,由于 ListField 已被删除,单击“事件”被传递到自动获得焦点的其他字段。到目前为止,我唯一的解决办法就是在我切换组件时使这些控件无法聚焦。
有没有一种更简洁的方法来做到这一点,在这段时间内必须使我的所有控件无法聚焦似乎有点像黑客。欢迎任何建议。
注意:在 ListField 的 navigationClick 方法中,我返回 True。
I have an application that makes use of the ListField component. As items are clicked on in the ListField, I remove the ListField from the manager and add in other managers.
My problem is that the click "event" is being passed to other fields that automatically get focus as a result of the ListField has been removed. So far my only away around this has been to make those controls unfocasable during the time I am switching out components.
Is there a neater way of doing this, having to make all my controls unfocasable for this small time seems like a bit of a hack. Any suggestions welcome.
Note: in my ListField's navigationClick method I am returning True.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以尝试 Manager.replace。请记住在此之前准备好两个字段:从旧字段中删除侦听器,将侦听器添加到新字段中。
You can also try Manager.replace. Remember to prepare both fields before that: remove listeners from old field, add listeners to new field.
改变事件的顺序怎么样:
What about changing the order of events: