Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Nested Datatables/ICEFaces datapaginator

843844Sep 18 2007 — edited Sep 18 2007
Hello All,

I'm having troubles to work with datables that are within another datatable and each nested datatable has its own datapaginator. I'm using ICEFaces. Here's a sample code:

<!-- PARENT DATATABLE -->
<ice:dataTable
            value="#{parentGroup.itens}"
            var="item" cellpadding="0"
            width="550px"
            columnClasses="leftColumn,middleColumn,rightColumn"
            id="data"
            rows="10">
            <!-- contract/expand column -->
            <ice:column>
		(...)
            </ice:column>
            <!-- Detalhamento -->
            <ice:column>
                <f:facet name="header">
                    <ice:outputText value=" "/>
                </f:facet>
                <ice:panelGroup styleClass="#{item.rowStyleClass}">
			(...)
                        <!-- Itens.... -->
                        <ice:panelGrid columns="1" cellspacing="0px">

                            <!-- NESTED DATATABLE -->

                            <ice:dataTable
                                value="#{item.expandedChildren}"
                                var="itemChild" cellpadding="0"
                                width="336px"
                                columnClasses="leftColumn,middleColumn,rightColumn"
                                id="dataChild"
                                rows="4">
                                <ice:column>
                                    <ice:panelGrid columns="1" cellspacing="0px" cellpadding="0px" width="20px">
					(...)
                                </ice:column>
                                <ice:column>
                               		(...)
                                </ice:column>
                            </ice:dataTable>
                            
                            <!-- PAGINATE NESTED TABLE  -->
                            <ice:panelGrid columns="1" styleClass="scrollerTableChild2" columnClasses="standardTable_ColumnCentered" visible="#{item.expanded}">
                                
                                <ice:dataPaginator id="test1"
                                                   for="dataChild"
                                                   fastStep="10"
                                                   pageCountVar="pageCount"
                                                   pageIndexVar="pageIndex"
                                                   paginator="true"
                                                   paginatorMaxPages="9"
                                >
                                    
                                    <f:facet name="first" >
                                        <ice:graphicImage url="css/xp/css-images/arrow-first.gif" style="border:none;"/>
                                    </f:facet>
                                    
                                    <f:facet name="last">
                                        <ice:graphicImage url="css/xp/css-images/arrow-last.gif" style="border:none;" />
                                    </f:facet>
                                    
                                    <f:facet name="previous">
                                        <ice:graphicImage url="css/xp/css-images/arrow-previous.gif" style="border:none;" />
                                    </f:facet>
                                    
                                    <f:facet name="next">
                                        <ice:graphicImage url="css/xp/css-images/arrow-next.gif" style="border:none;" />
                                    </f:facet>
                                    
                                    <f:facet name="fastforward">
                                        <ice:graphicImage url="css/xp/css-images/arrow-ff.gif" style="border:none;" />
                                    </f:facet>
                                    
                                    <f:facet name="fastrewind">
                                        <ice:graphicImage url="css/xp/css-images/arrow-fr.gif" style="border:none;" />
                                    </f:facet>
                                    
                                </ice:dataPaginator>
                                
                                <ice:dataPaginator id="test2"
                                                   for="dataChild"
                                                   rowsCountVar="rowsCount"
                                                   displayedRowsCountVar="displayedRowsCountVar"
                                                   firstRowIndexVar="firstRowIndex"
                                                   lastRowIndexVar="lastRowIndex"
                                                   pageCountVar="pageCount"
                                                   pageIndexVar="pageIndex"
                                >
                                    
                                    <ice:outputFormat value="P�gina {4} / {5}" styleClass="standard" >
                                        <f:param value="#{rowsCount}" />
                                        <f:param value="#{displayedRowsCountVar}" />
                                        <f:param value="#{firstRowIndex}" />
                                        <f:param value="#{lastRowIndex}" />
                                        <f:param value="#{pageIndex}" />
                                        <f:param value="#{pageCount}" />
                                    </ice:outputFormat>
                                    
                                </ice:dataPaginator>
                                
                            </ice:panelGrid>
                        </ice:panelGrid>
                    </ice:panelGrid>
                </ice:panelGroup>
                <f:facet name="footer">
                    <ice:outputText value="#{grupoDeItensManager.sum}" style="text-align: right;">
                        <f:convertNumber maxFractionDigits="2"
                                         groupingUsed="true"
                                         currencySymbol="R$ "
                                         maxIntegerDigits="7"
                                         type="currency"/>
                    </ice:outputText>
                </f:facet>
            </ice:column>
        </ice:dataTable>
    </ice:panelGrid>      
    
    <!-- PAGINATE PARENT -->
    <ice:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" >
        
        <ice:dataPaginator id="scroll_1"
                           for="data"
                           fastStep="10"
                           pageCountVar="pageCount"
                           pageIndexVar="pageIndex"
                           paginator="true"
                           paginatorMaxPages="9"
        >
            
            <f:facet name="first" >
                <ice:graphicImage url="css/xp/css-images/arrow-first.gif" style="border:none;"/>
            </f:facet>
            
            <f:facet name="last">
                <ice:graphicImage url="css/xp/css-images/arrow-last.gif" style="border:none;" />
            </f:facet>
            
            <f:facet name="previous">
                <ice:graphicImage url="css/xp/css-images/arrow-previous.gif" style="border:none;" />
            </f:facet>
            
            <f:facet name="next">
                <ice:graphicImage url="css/xp/css-images/arrow-next.gif" style="border:none;" />
            </f:facet>
            
            <f:facet name="fastforward">
                <ice:graphicImage url="css/xp/css-images/arrow-ff.gif" style="border:none;" />
            </f:facet>
            
            <f:facet name="fastrewind">
                <ice:graphicImage url="css/xp/css-images/arrow-fr.gif" style="border:none;" />
            </f:facet>
            
        </ice:dataPaginator>
        
        <ice:dataPaginator id="scroll_2"
                           for="data"
                           rowsCountVar="rowsCount"
                           displayedRowsCountVar="displayedRowsCountVar"
                           firstRowIndexVar="firstRowIndex"
                           lastRowIndexVar="lastRowIndex"
                           pageCountVar="pageCount"
                           pageIndexVar="pageIndex"
        >
            
            <ice:outputFormat value="P�gina {4} / {5}" styleClass="standard" >
                <f:param value="#{rowsCount}" />
                <f:param value="#{displayedRowsCountVar}" />
                <f:param value="#{firstRowIndex}" />
                <f:param value="#{lastRowIndex}" />
                <f:param value="#{pageIndex}" />
                <f:param value="#{pageCount}" />
            </ice:outputFormat>
            
        </ice:dataPaginator>
        
    </ice:panelGrid>
The result is that I can only navigate through the pagination of the FIRST nested element. I can also navigate through the pagination of the parent datatable. If I try to navigate through the pagination of any other nested datapaginator that's not the first one, it does not work.

Any thoughts?

Thanks in advance.

Aurelio
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2007
Added on Sep 18 2007
1 comment
220 views