如何在应用程序的主屏幕中显示屏幕
我的应用程序的详细信息下方有一个屏幕。屏幕名称 EventList 。这个屏幕设计的很饱满。有两个 ButtonField
Next
和 Previous
。在这两个Button
的底部,ListField
被放置在这个屏幕中。
当我点击 Next
或 Previous
时,我的 ListField
将更新。使用在此屏幕中创建的 updateListField() 方法
成功更新它。到目前为止一切都运转良好。但我担心的是,当我单击这些 Button
ListField
时,将需要时间(大约 3 或 4 秒)来更新新数据。在后台更新数据期间,我想显示 Massage
,例如 请稍候.../正在加载...
。我如何在不使用 PopupScreen
的情况下显示此内容。
我尝试过下面的代码,但无法正常工作。
VerticalFieldManager manager = new VerticalFieldManager();
manager.add(new LabelField("Please Wait..."));
Screen popup = new PopupScreen(manager);
如果我使用 PopupScreen 来完成此操作,则该屏幕的完整逻辑将发生变化,这将是一项耗时的任务。
请建议我如何在现有的 MainScreen
上添加 FieldManager
。
提前致谢 !!!
My application have one screen below the detail of that. Screen name EventList . This screen have designed full. There are two ButtonField
Next
and Previous
. At the bottom of these two Button
ListField
is placed in this screen.
When i click on Next
or Previous
my ListField
will update . It is updated successfully using updateListField() method
which is created in this screen. All is working fine up to this. But my concern is that when i click on these Button
ListField
will take time (around 3 or 4 second)to update new data. During my data updating in background i want to show Massage
like Please wait.../Loading...
. How can i show this without using PopupScreen
.
i had tried the below code but not working properly.
VerticalFieldManager manager = new VerticalFieldManager();
manager.add(new LabelField("Please Wait..."));
Screen popup = new PopupScreen(manager);
If i will done this using PopupScreen
my full logic will be change for that screen and it will time consuming task.
Please suggest me how can we add FieldManager
on existing MainScreen
.
Thanks in Advance !!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MainScreen 类包含一个可用于此目的的状态字段。在扩展 MainScreen 的类中添加:
以删除该状态:
但是,您需要在事件线程上执行此操作,然后返回,以便操作系统可以更新用户界面。如果您在事件线程(按下按钮时将调用您的代码的线程)上执行列表更新,那么您应该在单独的线程上执行该工作并使用 UiApplication.invokeLater() 或持有事件锁在用户界面上执行更新。
The MainScreen class includes a status field that you can use for this. In your class extending MainScreen add:
to remove that status:
However, you need to do this on the event thread and then return so the OS can update the user interface. If you are performing the update of your list on the event thread (the thread that will call your code when the button is pressed) then you should perform that work on a spearate thread and use UiApplication.invokeLater() or hold the event lock to perform updates on the user interface.