synchronize 2 datacsrollers
mrnice Jan 16, 2008 9:14 AMHi,
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"
footerClass="imagePreviewGalleryFooter">
<rich:column styleClass="imagePreviewGalleryCell">
<a4j:commandLink action="#{immoDetailBean.setDatascrollerPage}"
oncomplete="javascript:Richfaces.showModalPanel('imageGallery', {top:'100px', left:'100px'});">
<h:graphicImage value="#{image}" />
</a4j:commandLink>
</rich:column>
<f:facet name="footer">
<rich:datascroller for="imagePreviewTable" ajaxSingle="true" binding="#{immoDetailBean.previewDatascroller}"/>
</f:facet>
</rich:dataTable>
</h:form>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;
m_GalleryDatascroller.getDataTable().setFirst(page);
}
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>
<f:facet name="controls">
<h:graphicImage value="/images/ico_close.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('imageGallery')" />
</f:facet>
<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/> -->
</rich:column>
<f:facet name="footer">
<rich:datascroller for="imageTable" ajaxSingle="true" binding="#{immoDetailBean.galleryDatascroller}"/>
</f:facet>
</rich:dataTable>
</h:form>
</rich:modalPanel>
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