This is my xhtml page:
这是我的xhtml页面:
<a:region>
<h:form>
<a:poll id="poll" interval="#{pollBean.pollInterval}"
enabled="#{pollBean.pollEnabled}"
timeout="#{pollBean.timeout}" reRender="poll,messagesList" />
</h:form>
</a:region>
<h:form>
<rich:dataTable id="messagesList" value="#{pollBean.messages}" var="message">
<h:outputText value="#{message.content}" />
</rich:dataTable>
</h:form>
The rich:dataTable component does not rerendered after polling finished. After I use ui:repeat instead, it works fine. So can anyone explain this for me? Thanks.
rich:dataTable组件在轮询结束后不会重新运行。在我使用ui之后:重复,它可以正常工作。有人能给我解释一下吗?谢谢。
My application is built on Seam 2.2.1.CR2 and richfaces 3.3.3 and deployed on JBoss 6.0.0.
我的应用程序构建在Seam 2.2.1上。CR2和richfaces 3.3.3并部署在JBoss 6.0.0上。
Here is my simple PollBean.java:
下面是我简单的PollBean.java:
@Name("pollBean")
@Scope(ScopeType.SESSION)
@Restrict("#{identity.loggedIn}")
public class PollBean implements Serializable {
@In
private EntityManager entityManager;
private boolean pollEnabled = true;
private int pollInterval = 3000;
private int timeout = 3000;
/**
* Default constructor.
*/
public PollBean() {
}
// getters and setters omitted
/**
* @return Returns a list of messages.
*/
public List<Message> getMessages() {
@SuppressWarnings("unchecked")
List<Message> messages = this.entityManager.createQuery(
"select message from Message message").getResultList();
return messages;
}
}
1 个解决方案
#1
1
Kevin,
凯文,
Tested locally and code seems to be working fine so I suggest print all pollBean
properties and debug it.
在本地测试和代码似乎运行良好,所以我建议打印所有的pollBean属性并调试它。
#1
1
Kevin,
凯文,
Tested locally and code seems to be working fine so I suggest print all pollBean
properties and debug it.
在本地测试和代码似乎运行良好,所以我建议打印所有的pollBean属性并调试它。