1

i'm using richfaces 3.3.3 I've a rich:dataTable inside another rich:dataTable and both have a rich:dataScroller but the inner doesn't work:

<rich:dataTable id="dataTableVisibility" value="#{jsfGridUtenti.itemKeys}"                        
    var="roleName" cellspacing="1"
    cellpadding="1" border="1"
    styleClass="tab" style="width:60%"                                                 
    rowClasses="rdispari,rpari"
    headerClass="headTab" rows="3"
    rendered="#{jsfGridUtenti.renderPanelReportVisibility}">

    <f:facet name="footer">
        <rich:datascroller for="dataTableVisibility"
            fastStep="10" pagesVar="pageCountCl"
            pageIndexVar="pageIndexCl"
            maxPages="9" renderIfSinglePage="false"
            selectedStyle="font-weight:bold;">
        </rich:datascroller>
    </f:facet>
    <h:column>
        <f:facet name="header">
           #{applicationMessages.ruolo}
        </f:facet> 

        <a4j:commandLink reRender="reportUserVisibilityCompanyRoleClass"  action="#{jsfGridUtenti.deleteAssociationRole(roleName)}">                                                           
            <h:graphicImage styleClass="toolbarLabel"  url="../resources/img/cancella.png" />
        </a4j:commandLink>
        <rich:spacer height="1" width="8" /> 
        <h:outputText  style="font-size:11px" value="#{roleName}"/>                                          
    </h:column>
    <h:column>                                        
        <f:facet name="header">
            #{applicationMessages.companyAssociate}
        </f:facet>  

        <h:column>
             <rich:dataTable  id="dataTableCompany"
                 var="company" value="#{jsfGridUtenti.findCompanyInHashMap(roleName)}"                                                                                                         
                 style="width:100%" rows="5"
                 rowClasses="rdispari,rpari"
                 columnsWidth="10%,10%,80%"
                 headerClass="headTab">

                 <f:facet  name="footer">
                     <rich:datascroller for="dataTableCompany"
                         fastStep="10" pagesVar="pageCountCls"
                         pageIndexVar="pageIndexCls"
                         maxPages="9" ajaxSingle="true"
                         selectedStyle="font-weight:bold;"
                         renderIfSinglePage="false">                                                          
                     </rich:datascroller>
                 </f:facet>

                 <h:column>
                     <a4j:commandLink reRender="reportUserVisibilityCompanyRoleClass"  action="#{jsfGridUtenti.deleteAssociationCompany(roleName,company)}">
                         <h:graphicImage  styleClass="toolbarLabel"  url="../resources/img/cancella.png" />
                     </a4j:commandLink>                                                                                        
                 </h:column>
                 <h:column>
                     <a4j:commandLink  immediate="true" action="#{jsfGridUtenti.setCompanyToShow(roleName,company)}"            
                         reRender="showClassi,panelGridReport">
                         <h:graphicImage  styleClass="toolbarLabel"  url="../resources/img/lente.png" />                                                             
                     </a4j:commandLink>
                 </h:column>
                 <h:column>
                     <h:outputText style="font-size:11px" value="#{company.label}"/>
                 </h:column>
             </rich:dataTable>                                                                                                                                                                                                                                                                                                
         </h:column> 
     </h:column>
 </rich:dataTable>

Now when I click on the outer rich:dataScroller it works well, instead when I click on the inner nothing happens. How can I fix?

Emil Sierżęga
  • 1,785
  • 2
  • 31
  • 38
Davide
  • 131
  • 5
  • 18
  • You must not use a `` inside another ``. Instead, use `` as shown in the [official documentation](http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_subTable.html). – Luiggi Mendoza Nov 19 '12 at 16:44

2 Answers2

1

This is a known issue. rich:datascroller doesn't support nested iteration components such as dataTable, repeat etc. There is a JIRA issue for this.

Did you say 'nothing happens'? Did you look at your console? Doesn't it display a warning like this?

The requested page #2 isn't found in the model containing 1 pages. Paging is reset to page #1
prageeth
  • 7,159
  • 7
  • 44
  • 72
  • This message doesn't appear in the console of my brother. I work around the problem by using a 'rich:subTable' Thanks for the reply. – Davide Nov 21 '12 at 14:03
  • Sorry, I wanted to say "in the console of my browser". :) – Davide Nov 22 '12 at 08:50
1

I got the same warning message and solved it by adding a session variable like:

<rich:dataScroller for="table" page="#{sessionBean.page}" />

In my case the bean wasn't accessible (due to scope) before I changed the code. I was on the wrong track because I would have expected a warning/error pointing out that the problem is related to the expression language.

stacker
  • 68,052
  • 28
  • 140
  • 210