I have a CarCategory object, and in that object is a List of CarObjects. I would like the parent (Category) object to be sortable and the child h:datatable located in the detailStamp facet to be sortable also. Everything renders fine, but the datatable clientID is duplicated on each child and when I perform a sort on the child table, it sorts all the children and does not do an independent sort. Same with paging.
I have made the following changes to org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer in the HtmlCommandLink method :
(around line 397)
added: link.setId(scroller.getId() + id + rand(1,1000));
- the rand() method is just giving me a random int in that range, which in turn gives me a random ID. This is allowing me to do paging on the child tables.
- the built-in sorting and paging is tied to the datatable ID, is there a way to change the ID/client ID dynamically in the HtmlDataTableHack page?
<t:dataTable
rows="10"
id="dataSortData2"
value="#{inventoryList.carInventory}"
var="category"
varDetailToggler="detailToggler"
>
<t:column style="width:150px;">
<h:commandLink rendered="#{detailToggler.currentDetailExpanded
}" action=""> ....
....
</h:commandLink>
</t:column>
<f:facet name="detailStamp" >
<t:panelGroup id="pg1">
<t:dataTable
rows="10"
id="dataSortData3"
value="#{category.inventoryItem}"
var="item2"
rowCountVar="totalRows"
rowIndexVar="thisRow"
preserveSort="true"
>
<t:column style="width:75px;" sortPropertyName="mileage" sortable="true">
<f:facet name="header">
<h:outputText value="-----"/>
</f:facet>
<h:outputText value="#{
item2.mileage}"/>
</t:column>
<t:column style="width:75px;" sortPropertyName="mileage" sortable="true">
...(Many more columns)
</t:column>
</t:dataTable>
<t:dataScroller id="datascroller1"
for=""
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;"
actionListener="#{
inventoryList.scrollerAction}"
>
<f:facet name="first1" >
<h:outputText id="datascrollerFirst" value="First" />
</f:facet>
<f:facet name="last1">
<h:outputText id="datascrollerLast" value="Last" />
</f:facet>
<f:facet name="previous1">
<h:outputText id="datascrollerPrev" value="Prev" />
</f:facet>
<f:facet name="next1">
<h:outputText id="datascrollerNext" value="Next" />
</f:facet>
<f:facet name="fastforward1">
<h:outputText id="datascrollerFFW" value="FFW" />
</f:facet>
<f:facet name="fastrewind1">
<h:outputText id="datascrollerFRW" value="FRW" />
</f:facet>
</t:dataScroller>
</t:panelGroup>
My main objective is to have the child tables in the detailStamp sort and page independent of each other.
Thanks for any help on this,
Wesley Hales

