Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 有人能解释为什么a4j:poll不能重新发布rich:dataTable吗?_Java_Jsf_Richfaces_Seam - Fatal编程技术网

Java 有人能解释为什么a4j:poll不能重新发布rich:dataTable吗?

Java 有人能解释为什么a4j:poll不能重新发布rich:dataTable吗?,java,jsf,richfaces,seam,Java,Jsf,Richfaces,Seam,这是我的xhtml页面: <a:region> <h:form> <a:poll id="poll" interval="#{pollBean.pollInterval}" enabled="#{pollBean.pollEnabled}" timeout="#{pollBean.timeout}" reRender="poll,messagesList" /> </h:fo

这是我的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>
轮询完成后,rich:dataTable组件不会重新加载。在我使用ui:repeat之后,它工作得很好。有人能给我解释一下吗?谢谢

我的应用程序构建在Seam 2.2.1.CR2和richfaces 3.3.3上,并部署在JBoss 6.0.0上

下面是我的简单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;
    }
}
凯文


本地测试,代码似乎运行良好,因此我建议打印所有pollBean属性并进行调试。

您是否尝试过将所有内容移动到一个表单中?@JSS这不是问题,应该使用多个表单work@JJ-我同意不应该,但我只是想去看看。谢谢你,JSS。调试表明a4j:poll工作正常,pollBean.getMessages按预期调用,没有发生异常,但rich:dataTable仍然没有重新呈现。你能把你的工作代码贴在这里吗?这是我的错。模板中包含另一个具有相同id messagesList的组件。删除重复id后,rich:dataTable工作。