0 Replies Latest reply on Jun 1, 2009 12:51 PM by Peter Irmstadt

    ScrollableDataTable doesn't get rerendered using AJAX

    Peter Irmstadt Newbie


      In my JBoss Seam project I do have two Entity classes. They are connected by a 1:n relation.

      My problem exists on a page where all assigned Chargen ('child') of one Artikel ('parent') are shown and the user is enabled to create new ones.

      This is how the table is created on my Facelets page:

      <a4j:outputPanel id="pnlTable">
       <rich:scrollableDataTable width="365px" height="220px" value="#{artikel.chargen}" var="_charge"
       id="tblChargen" rendered="#{artikelHome.managed}">
       <f:facet name="header">Nummer</f:facet>
       <h:outputText value="#{_charge.nummer}" />
       <f:facet name="header">Bestand</f:facet>
       <h:outputText value="#{_charge.bestand}" />

      The creation of new Charge objects is done on a rich:modalPanel that is created the following way:

      <rich:modalPanel id="pnlChargeCreate">
       <f:facet name="header">Charge erstellen</f:facet>
       <a4j:form id="a4jform">
       <h:panelGrid columns="1">
       <s:decorate template="/layout/edit.xhtml">
       <ui:define name="label">Chargennummer</ui:define>
       <h:inputText value="#{chargeHome.instance.nummer}"
       required="true" style=" width : 200px;" />
       <s:decorate template="/layout/edit.xhtml">
       <ui:define name="label">Anzahl</ui:define>
       <h:inputText value="#{chargeHome.instance.bestand}"
       converter="javax.faces.Integer" required="true"
       style=" width : 200px;" />
       <h:panelGrid columns="2">
       <a4j:commandButton rerender="pnlTable,tblChargen" action="#{chargeHome.persist}"
       onclick="#{rich:component('pnlChargeCreate')}.hide()" value="Erstellen" />
       <input type="button" onclick="#{rich:component('pnlChargeCreate')}.hide()" value="Abbrechen" />

      The action is performed and the new Charge object is stored to the database, but the table isn't refreshed and the new Charge isn't shown. If I manually refresh the page the object appears.

      What is my mistake? What can I do to enable the refresh witouth postback and just by AJAX?

      Thank you in advance!