简体   繁体   English

JSF ajax 在属性更改时重新渲染组件

[英]JSF ajax rerender component when property changes

Can I re-render some component when property in the bean is changed.更改 bean 中的属性时,我可以重新渲染某些组件吗? For example if I have ApplicationScoped bean and one of it's properties is List, I wan every time when some user add element in the list, everybody else to see the change, without to submit the form.例如,如果我有 ApplicationScoped bean 并且它的属性之一是 List,我希望每次当一些用户在列表中添加元素时,其他人都可以看到更改,而无需提交表单。 Something like chat room.聊天室之类的。 When someone add message to the collection, it has to be rendered immediately to the other side.当有人向集合添加消息时,它必须立即呈现给另一方。

You should use server-side push.您应该使用服务器端推送。 Watch this to know how it can be done with Oracle ADF Faces.观看视频以了解如何使用 Oracle ADF Faces 来完成。 And this with ICEfaces push component与 ICEfaces 推送组件

You can use either <a4j:push> or <a4j:poll> to refresh partial pages on a timer.您可以使用<a4j:push><a4j:poll>在计时器上刷新部分页面。

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

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