4 Replies Latest reply on Feb 17, 2009 10:28 AM by Konstantin Mishin

    ScrollableDataTable can not be reRendered by a4j:support

    Dongyao Zhao Novice

      ScrollableDataTable can not be reRendered by a4j:support. Only the SDT is wrapped with a4j:outputPanel. But after sort the header of the SDT is disappeared and crash the whole table. I use RF:3.3.0, jsf-1.2, FF:3.0.6 and IE7. ps. The SDT can be reRendered by a a4j:commandButton.

      <a4j:outputPanel layout="block" id="tableId">
       <ui:include src="/panel/dataTable.xhtml" />
      </a4j:outputPanel>
      


      SDT:
       <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:dim="http://dimetis.de/jsf">
       <rich:scrollableDataTable id="table" height="200px" width="220px"
       value="#{appBean.items}" var="item" sortMode="single" rows="25"
       rowClasses="taskRows" columnClasses="taskColumns">
       <rich:column width="104px" sortable="true" id="name">
       <f:facet name="header">
       <h:outputText value="Name"/>
       </f:facet>
       <a4j:outputPanel layout="block" style="border:1px solid black">
       <rich:dragSupport dragIndicator=":form:indicator" dragType="pidDrag"
       dragValue="#{item.name}" ondragstart="forceReRenderDropZone()">
       <rich:dndParam name="label" value="#{item.name}" />
       </rich:dragSupport>
       <h:outputText value="#{item.name}" />
       </a4j:outputPanel>
       </rich:column>
       <rich:column width="104px" sortable="true" id="value">
       <f:facet name="header">
       <h:outputText value="Value"/>
       </f:facet>
       <div style="margin-top:2px;display:block;">
       <h:outputText value="#{item.value}" />
       </div>
       </rich:column>
       <rich:componentControl id="taskcontrolid" for="tContextMenu" operation="show"/>
       </rich:scrollableDataTable>
      </ui:composition>
      


      a4j:push come from richfaces demo

      <h:form>
       <a4j:push interval="1000" eventProducer="#{push.addListener}" oncomplete="alert('updated');"
       reRender="tableId" enabled="#{push.enabled}" id="push" ajaxSingle="true"/>
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="Push Example"/>
       </f:facet>
       <h:panelGrid columns="1" id="out">
       <h:outputText rendered="#{!push.enabled}" value="Press Start to run push example"/>
       <h:panelGroup rendered="#{push.enabled}">
       <h:outputText value="Generated UUID:"/>
       <h:outputText value="#{push.uuid}"/>
       </h:panelGroup>
       <h:panelGroup>
       <a4j:commandButton value="Start" action="#{push.start}"
       ajaxSingle="true" rendered="#{!push.enabled}" reRender="push, out"/>
       <a4j:commandButton value="Stop" action="#{push.stop}"
       ajaxSingle="true" rendered="#{push.enabled}" reRender="push, out"/>
       </h:panelGroup>
       </h:panelGrid>
       </rich:panel>
       </h:form>
      


        • 1. ScrollableDataTable can not be reRendered by a4j:push
          Dongyao Zhao Novice

           

          "darmstadter" wrote:
          ScrollableDataTable can not be reRendered by a4j:push. Only the SDT is wrapped with a4j:outputPanel. But after sort the header of the SDT is disappeared and crash the whole table. I use RF:3.3.0, jsf-1.2, FF:3.0.6 and IE7. ps. The SDT can be reRendered by a a4j:commandButton.

          <a4j:outputPanel layout="block" id="tableId">
           <ui:include src="/panel/dataTable.xhtml" />
          </a4j:outputPanel>
          


          SDT:
          
           <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:rich="http://richfaces.org/rich"
           xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:dim="http://dimetis.de/jsf">
           <rich:scrollableDataTable id="table" height="200px" width="220px"
           value="#{appBean.items}" var="item" sortMode="single" rows="25"
           rowClasses="taskRows" columnClasses="taskColumns">
           <rich:column width="104px" sortable="true" id="name">
           <f:facet name="header">
           <h:outputText value="Name"/>
           </f:facet>
           <a4j:outputPanel layout="block" style="border:1px solid black">
           <rich:dragSupport dragIndicator=":form:indicator" dragType="pidDrag"
           dragValue="#{item.name}" ondragstart="forceReRenderDropZone()">
           <rich:dndParam name="label" value="#{item.name}" />
           </rich:dragSupport>
           <h:outputText value="#{item.name}" />
           </a4j:outputPanel>
           </rich:column>
           <rich:column width="104px" sortable="true" id="value">
           <f:facet name="header">
           <h:outputText value="Value"/>
           </f:facet>
           <div style="margin-top:2px;display:block;">
           <h:outputText value="#{item.value}" />
           </div>
           </rich:column>
           <rich:componentControl id="taskcontrolid" for="tContextMenu" operation="show"/>
           </rich:scrollableDataTable>
          </ui:composition>
          


          a4j:push come from richfaces demo

          <h:form>
           <a4j:push interval="1000" eventProducer="#{push.addListener}" oncomplete="alert('updated');"
           reRender="tableId" enabled="#{push.enabled}" id="push" ajaxSingle="true"/>
           <rich:panel>
           <f:facet name="header">
           <h:outputText value="Push Example"/>
           </f:facet>
           <h:panelGrid columns="1" id="out">
           <h:outputText rendered="#{!push.enabled}" value="Press Start to run push example"/>
           <h:panelGroup rendered="#{push.enabled}">
           <h:outputText value="Generated UUID:"/>
           <h:outputText value="#{push.uuid}"/>
           </h:panelGroup>
           <h:panelGroup>
           <a4j:commandButton value="Start" action="#{push.start}"
           ajaxSingle="true" rendered="#{!push.enabled}" reRender="push, out"/>
           <a4j:commandButton value="Stop" action="#{push.stop}"
           ajaxSingle="true" rendered="#{push.enabled}" reRender="push, out"/>
           </h:panelGroup>
           </h:panelGrid>
           </rich:panel>
           </h:form>
          


          • 2. Re: ScrollableDataTable can not be reRendered by a4j:support
            Dongyao Zhao Novice

            Sorry, i have written the wrong title. The title should be " ScrollableDataTable can not be reRendered by a4j:push". p.s I can not find out where i can edit my post??

            • 3. Re: ScrollableDataTable can not be reRendered by a4j:support
              Dongyao Zhao Novice

              With a4j:outputPanel layout="none", the table is not reRendered. with layout="inline/block", crash the SDT. why the SDT can not reRendered directly by the a4j:push?? this is a bug???

              • 4. Re: ScrollableDataTable can not be reRendered by a4j:support
                Konstantin Mishin Novice

                You might try to set attribute "interval" bigger than 1000 (e.g. 10000) or/and to use rich:queue. The queue should be global. See documentation.