简体   繁体   中英

can anyone explain why a4j:poll cannot reRender rich:dataTable?

This is my xhtml page:

<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.

My application is built on Seam 2.2.1.CR2 and richfaces 3.3.3 and deployed on JBoss 6.0.0.

Here is my simple 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;
    }
}

Kevin,

Tested locally and code seems to be working fine so I suggest print all pollBean properties and debug it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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