0

ページネーション付きのacedatatableを使用しています。さて、いくつかの行を選択した後のページで、別のページに移動して戻ってくると、選択が消えます。行はもう選択されていません。

コードは次のとおりです。

<ace:dataTable var="device" value="#{reportBean.searchTableList}"
                        id="MeterTable" rows="10" paginator="true"
                        paginatorPosition="bottom" page="1" selectionMode="multiple"
                        stateMap="#{reportBean.rowStateMap}" pageCount="4" 
                        rowStyleClass="oddRow1,evenRow1">


                        <ace:column id="column3" headerText="Meter Name"
                            sortBy="#{device.device_name}" filterBy="#{device.device_name}"
                            selected="true"
                            filterMatchMode="contains" styleClass="dataTableHeader">
                            <ice:outputText value=" #{device.device_name}" />
                        </ace:column>
</ace:dataTable>
4

1 に答える 1

2

Seems like your reportBean is RequestScoped. this means when you browse to the page with the table the reportBean is loaded and when you do a selection the selection values are stored in reportBean.rowStateMap. when browsing to another page the reportBean and the selection information get deleted because it is not the same request (Request Scoped!). when you browse to the table page again, a new reportBean is created which doesn't has any information about the selection

You can try changing your reportBean to SessionScoped but that has other impacts which you should consider.

于 2012-11-09T14:11:37.390 に答える