简体   繁体   English

嵌入式rich:dataTable中的可排序列

[英]Sortable columns in embedded rich:dataTable

I have a jsp page containing a rich:dataTable with some data regarding my clients. 我有一个jsp页面,其中包含rich:dataTable以及一些有关我的客户的数据。
In each row I have another rich:dataTable containing some commission rates for the current customer. 在每一行中,我还有另一个rich:dataTable,其中包含当前客户的一些佣金率。
The code is something like this: 代码是这样的:

            <rich:dataTable id="clientList" value="#{clientsBean.model}" var="client" rows="15">
                <rich:column id="nameColumn">
                    <f:facet name="header">
                        <h:outputText value="#{msg.manageclients_client_name}" />
                    </f:facet>
                    <h:outputText id="name" value="#{client.name}" />
                </rich:column>
                <rich:column id="clientRatesColumn">
                    <f:facet name="header">
                        <h:outputText value="#{msg.manageclients_client_rates}" />
                    </f:facet>
                    <rich:dataTable id="clientRates" value="#{client.clientRates}" var="clientRate">
                        <rich:column id="clientRateProduct" sortable="true" sortBy="#{clientRate.product.qualifiedName}">
                            <f:facet name="header">
                                <h:outputText value="#{msg.manageclients_rate_product}" />
                            </f:facet>
                            <h:outputText value="#{clientRate.product.qualifiedName}" />
                        </rich:column>
                        ...
                    </rich:dataTable>
                </rich:column>
                ...
            </rich:dataTable>

As you can see the embedded rich:dataTable (id= clientRates ) contains a sortable column (id= clientRateProduct ). 如您所见,嵌入式rich:dataTable(id = clientRates )包含一个可排序的列(id = clientRateProduct )。
My problem is that if I click on the sort icon in the clientRateProduct column for the current client all clientRates dataTables will be sorted (not just the one for the current client). 我的问题是,如果单击当前客户端的clientRateProduct列中的排序图标, clientRateProduct 所有 clientRates dataTables进行排序(而不仅仅是当前客户端的那个)。
I want the sort action to be performed just on the current clientRates dataTable. 我希望仅在当前clientRates dataTable上执行排序操作。 Can anybody please suggest a solution ? 有人可以提出解决方案吗?

I use RichFaces 3.2.2.SR1. 我使用RichFaces 3.2.2.SR1。 & Tomcat 6.0.29 &Tomcat 6.0.29

you should encapsulate the inner data table with 您应该将内部数据表封装为

<a4j:region renderRegionOnly="true" >

so only it will be updated from the ajax request 所以只有它会从ajax请求中更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM