1 Reply Latest reply on Jan 17, 2008 8:37 AM by Jan Blankenhorn

    synchronize 2 datacsrollers

    Jan Blankenhorn Newbie


      My Setup: Richfaces 3.1.2 with Myfaces and facelets

      I got the following problem:

      I have a page with 2 rich:dataTable's. One is normally displayed on the page, the other is inside a modalPanel. Both show nearly the same content.

      Now i want to synchronize these 2 datatables and their datascrollers.

      I open the modalPanel from within the "normal" datatable

      <h:form id="imageForm">
       <rich:dataTable rendered="#{immoDetailBean.attachmentsCount > 0}" id="imagePreviewTable" rows="1"
       var="image" value="#{immoDetailBean.previewAttachments}" styleClass="imagePreviewGallery"
       <rich:column styleClass="imagePreviewGalleryCell">
       <a4j:commandLink action="#{immoDetailBean.setDatascrollerPage}"
       oncomplete="javascript:Richfaces.showModalPanel('imageGallery', {top:'100px', left:'100px'});">
       <h:graphicImage value="#{image}" />
       <f:facet name="footer">
       <rich:datascroller for="imagePreviewTable" ajaxSingle="true" binding="#{immoDetailBean.previewDatascroller}"/>

      Here you see the function which is called. I try to set the page of the modalPanel-dataTable in here.

      public void setDatascrollerPage()
       int page = m_PreviewDatascroller.getPageIndex() - 1;

      at last the modalPanel

      <rich:modalPanel id="imageGallery" height="500" width="650" zindex="2000" resizeable="false" moveable="true">
       <f:facet name="header">
       <h:outputText value="Image Gallery" />
       <f:facet name="controls">
       <h:graphicImage value="/images/ico_close.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('imageGallery')" />
       <h:form id="modPanelForm">
       <rich:dataTable styleClass="imageGallery" rendered="#{immoDetailBean.attachmentsCount > 0}" id="imageTable" rows="1"
       var="image" value="#{immoDetailBean.attachments}" footerClass="imageGalleryFooter">
       <rich:column styleClass="imageGalleryCell">
       <img src="#{image}" class="image"/>
       <!-- <h:graphicImage value="#{image}" width="620px" ma/> -->
       <f:facet name="footer">
       <rich:datascroller for="imageTable" ajaxSingle="true" binding="#{immoDetailBean.galleryDatascroller}"/>

      I guess, most of what i do is right, the only problem is, that the Datascroller inside the modalPanel, doesn't get the new Values which are set in the Java function.

      Thanks in advance