Can someone explain why a4j: polling 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 restart after polling is complete. After I use ui: repeat instead, it works fine. So can someone explain this to me? Thank.

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;
    }
}
+3
source share
1 answer

Kevin

It is tested locally and the code works fine, so I suggest printing all the properties pollBeanand debugging it.

+1
source

Source: https://habr.com/ru/post/1789742/


All Articles