从服务器事件更新ui组件 [英] Update ui components from server event

查看:178
本文介绍了从服务器事件更新ui组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在服务器进程完成或与此相关的任何其他时间,我将如何更新UI组件?

How would I go about updating a UI component when a server process finishes or anytime else for that matter?

可以\我应该

  • 扩展UI组件并在其上注册某种EventListener吗?
  • 将UI组件绑定到支持bean中吗?
  • 使用一些新的PrimePush功能吗?
  • 还有别的吗?

如果有人可以引导我朝正确的方向前进,我将不胜感激.

If anyone could guide me in the right direction I'd appreciate it.

案例一

服务器进程结束并更新数据库.
我想自动 根据新信息使用新行更新DataTable.
我不想轮询新数据.

Server process ends and updates the database.
I want to automatically update a DataTable with new rows based on the new information.
I don't want to poll for the new data.

编辑

我想从EJB无状态Bean更新UI组件(primefaces数据表)

I want to update the UI component (a primefaces datatable) from an EJB Stateless Bean

推荐答案

您没有提到正在使用哪个版本的primeface,但是您可以使用

You didnt mention which version of primefaces you are using but you can update components from backed bean with addpartialupdatetarget.

RequestContext context = RequestContext.getCurrentInstance();
context.addPartialUpdateTarget("myForm:myComponent");

这篇关于从服务器事件更新ui组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆