3 Replies Latest reply on Mar 13, 2007 6:10 PM by demetrio812

    problem refreshing rich:dataTable

    demetrio812 Apprentice

      Hi,
      I have a selectOneMenu and a rich:dataTable (inside a tab), when I change the menu I want to reload the data in the table, if I use t:dataTable it works but when I use rich:dataTable it refresh sometime but other times not and I have to reload the page to see the correct data.

      The bean I use is in session.

      this is the piece of code I'm using:

      <!-- ....... -->
      <rich:tab label="Sito">
       <a4j:form ajaxSubmit="false" reRender="articoli">
       <h:panelGrid columns="1">
       <h:panelGroup>
       <h:outputText value="Sezione: "></h:outputText>
       <h:selectOneMenu value="#{daoGestione.tipologiaArticoloSelezionata}">
       <f:selectItems value="#{daoGestione.tipologieArticoliText}"/>
       </h:selectOneMenu>
       <a4j:commandLink reRender="articoli" immediate="true" action="#{daoGestione.cambiaTipologia}">
       <h:graphicImage alt="Cambia tipologia" title="Cambia tipologia" value="/templates/images/icons/aggiorna_small.png" border="0" style="vertical-align: middle"></h:graphicImage>
       </a4j:commandLink>
       </h:panelGroup>
       </h:panelGrid>
       </a4j:form>
       <rich:tabPanel switchType="client">
       <rich:tab label="Lista">
       <h:panelGrid id="rapg" columns="1" width="100%">
       <rich:dataTable id="articoli" var="row" style="width: 100%;"
       rows="10" value="#{daoGestione.articoli}">
       <f:facet name="header">
       <h:outputText value="#{daoGestione.tipologiaArticoloSelezionataDescrizione}"></h:outputText>
       </f:facet>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Oggetto"></h:outputText>
       </f:facet>
       <h:inputText id="oggetto" value="#{row.oggetto}" required="true" requiredMessage="Campo obbligatorio"></h:inputText>
       <br/><h:message for="oggetto" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Data"></h:outputText>
       </f:facet>
       <h:inputText id="data" value="#{row.data}" required="true" requiredMessage="Campo obbligatorio" style="width: 80px;">
       <f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
       </h:inputText>
       <br/><h:message for="data" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column rendered="#{daoGestione.tipologiaArticoloSelezionata=='5'}">
       <f:facet name="header">
       <h:outputText value="Ora"></h:outputText>
       </f:facet>
       <h:inputText id="ora" value="#{row.ora}" style="width: 80px;">
       <f:convertDateTime type="time" pattern="HH:mm"/>
       </h:inputText>
       <br/><h:message for="ora" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Testo"></h:outputText>
       </f:facet>
       <h:inputTextarea value="#{row.testo}" rows="10" style="width: 300px;"></h:inputTextarea>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Parole chiave"></h:outputText>
       </f:facet>
       <h:inputText id="pchiave" value="#{row.paroleChiave}"></h:inputText>
       <br/><h:message for="pchiave" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="URL articolo"></h:outputText>
       </f:facet>
       <h:inputText id="urla" value="#{row.urlArticolo}"></h:inputText>
       <br/><h:message for="urla" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="URL video"></h:outputText>
       </f:facet>
       <h:inputText id="urlv" value="#{row.urlVideo}"></h:inputText>
       <br/><h:message for="urlv" errorClass="errorMessage"></h:message>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value=""></h:outputText>
       </f:facet>
       <a4j:commandLink action="#{daoGestione.salvaArticolo}">
       <h:graphicImage alt="Salva" title="Salva" value="/templates/images/icons/save.gif" border="0" style="vertical-align: middle"></h:graphicImage>
       <f:setPropertyActionListener value="#{row}" target="#{daoGestione.articolo}" />
       </a4j:commandLink>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value=""></h:outputText>
       </f:facet>
       <a4j:commandLink reRender="rapg" onclick="if (!confirm('Sei sicuro?')) return false;" action="#{daoGestione.delArticolo}">
       <h:graphicImage alt="Elimina" title="Elimina" value="/templates/images/icons/delete.gif" border="0" style="vertical-align: middle"></h:graphicImage>
       <f:setPropertyActionListener value="#{row}" target="#{daoGestione.articolo}" />
       </a4j:commandLink>
       </h:column>
       </rich:dataTable>
       <rich:datascroller for="articoli"/>
       </h:panelGrid>
       </rich:tab>
       <rich:tab label="Nuovo">
       <a4j:form ajaxSubmit="true">
       </a4j:form>
       </rich:tab>
       </rich:tabPanel>
      </rich:tab>
      
      <!-- ....... -->