I look at this example and dont understand how to save selection after user click on one of already selected rows. So for example when user select 3 rows and make a click on one of this it will be show information about only one selected rows.
Now I have DataTable with lazy loading and context menu like this:
<p:dataTable id="al_table" value="#{alarmTable.alarms}"
selection="#{alarmTable.selectedAlarm}" selectionMode="multiple"
var="alarm" resizableColumns="true" paginator="true" rows="50"
sortBy="#{alarm.alarmTimestamp}" sortOrder="descending"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="25, 50, 75, 100" lazy="true"
style="table-layout: auto">
<p:ajax event="rowDblselect" update=":form:display"
oncomplete="alarmDialog.show()" />
And all work very well except selection. With this behavior like now i can’t do any action with multi rows at the same time, because it always lose selection. How to resolve this?
It’s not possible in current implementation. You should use buttons not in context menu.