scrollingDataTable questions
bostone May 15, 2008 9:50 AMI really like to use scrollingDataTable in my project, but so far the only successful thing I can achieve is to display first portion of data. Here's short list of what I wasn't able to do:
I can't scroll data. Scrolling starts and then table renders itself empty. Scrolling back does not bring back the data
Action on click/doubleclick works only on empty row. When I click on row with data I can see AJAX request but the action code is never fired. There's no warnings/messages anywhere (including rich:messages) that would give me any hint
When attempting to extend data model - walk() is never called so it's useless for scrolling. Plus I had to provide implementation for setRowIndex which should never be called but is called extensively
I map rows to a custom object that has a compound key (another object). Attempt to provide row converter filed since SDT uses it's own org.richfaces.model.ScrollableTableDataModel$SimpleRowKey as a key
Don't know which scope I should use for the backing bean? I like to use request, but changing to session doesn't change anything, and if I try to put a4j:keepAlive the table would simply refuse to render
Here's the table. #{deviceMasterFormBean.searchResultModel} is a list of POJOs
<f:subview xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<rich:panel id="searchResultPanel" binding="#{deviceMasterFormBean.searchResultPanel}"
rendered="true">
<f:facet name="header">Device search results</f:facet>
<rich:scrollableDataTable value="#{deviceMasterFormBean.searchResultModel}"
var="device" height="150px" width="100%" first="0" rows="20"
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" rowClasses="cur">
<rich:column width="150px">
<f:facet name="header">
<h:outputText value="Tag #" />
</f:facet>
<h:outputText value="#{device.tagNumber}" />
</rich:column>
<rich:column width="150px">
<f:facet name="header">
<h:outputText value="IP" />
</f:facet>
<h:outputText value="#{device.ip}" />
</rich:column>
<rich:column width="200px">
<f:facet name="header">
<h:outputText value="Hostname" />
</f:facet>
<h:outputText value="#{device.name}" />
</rich:column>
<rich:column width="200px">
<f:facet name="header">
<h:outputText value="Domain" />
</f:facet>
<h:outputText value="#{device.domainName}" />
</rich:column>
<rich:column width="200px">
<f:facet name="header">
<h:outputText value="Namespace" />
</f:facet>
<h:outputText value="#{device.namespace}" />
</rich:column>
<a4j:support event="onRowDblClick" actionListener="#{deviceMasterFormBean.onSelectSearchResult}"
ajaxSingle="true" reRender="searchTogglePanel,updateControls,deviceTabs"/>
</rich:scrollableDataTable>
<rich:toggleControl switchToState="step1" value="Back to Search" />
</rich:panel>
</f:subview>