5 Replies Latest reply on Jul 10, 2011 12:09 AM by Nick Belaevski

    poll, messages, ...

    paul.setzermann Newbie

      Hi all,

       

      I try to visualize (status) messages sent from the server (from the process behind 'fillAdbBean.fill() which is the action method) to inform the user.

      When the request is been started the polling does not work anymore.

      Is it possible that both events (request and poll) are working at the same time?

      I tried to fix it with the 'onclick' event or/and 'reRender' but this does not work either.

      Does anyone have a solution for this Problem? Or is there a better way to do this?

      Thanks in advance.

       

      Cheers,

      Paul

       

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
      
        <rich:panel id="filldbPanel">
        <h:form id="filldb">
            <h:panelGrid>
            <h:panelGrid columns="2" columnClasses="firstcolumn,">
           <h:outputText value="Database:"/> <rich:select id="database"value="#{fillAdbBean.dbValue}"><f:selectItems value="#{fillAdbBean.dbList}"></f:selectItems></rich:select>
      
            <h:outputText value="Species:"/> <rich:select id="species"value="#{fillAdbBean.speciesValue}"><f:selectItemsvalue="#{fillAdbBean.speciesList}"></f:selectItems></rich:select>
        </h:panelGrid>
        <a4j:status>
                          <f:facet name="start">
                              <h:graphicImage value="/images/ai.gif" alt="ai" />
                          </f:facet>
                      </a4j:status>
      <a4j:commandButton value="Start" execute="@form" action="#{fillAdbBean.fill()}" reRender="pollForm:poll"onclick="A4J.AJAX.StartPoll('pollForm:poll');"/>
        <h:panelGrid>
        <rich:messages colspan="2"></rich:messages>
        </h:panelGrid>
        </h:panelGrid>
        </h:form>
      
        </rich:panel>
        <h:form id="pollForm">
                <a4j:poll id="poll" interval="1000" enabled="true" render="pollForm:poll,dataForm:dataTable" />
          </h:form>
          <h:form id="dataForm">
          <h:panelGrid id="dataGrid">
        <rich:dataTable id="dataTable" value="#{aDBMessageController.msgList}" var="msg">
            <f:facet name="header">
          <h:outputText value="Messages" />
        </f:facet>
      
        <rich:column id="messageCol">
          <f:facet name="header">
          <h:outputText value="Message:" />
          </f:facet>
          <h:outputText class="rf-msg-inf" value="#{msg.summary}"></h:outputText>
        </rich:column>
        </rich:dataTable>
        </h:panelGrid>
        </h:form>
        <a4j:log></a4j:log>
      </ui:composition>