When I am using selectCheckboxMenu component with multiple selection, after each item selection, the order of selected items in Collection (selectedEntityList) resets exactly to order of the items in collection (allEmployeeList). I need to keep selected items sequence how they were selected .
For example: In my collection (allEmployeeList) I have employees list witch was ordered by name:
Antony Gurk (1)
Beny Short (2)
Cavy Shrimk (3)
If I select step by step in selectCheckboxMenu items in this sequence:
Beny Short (2)
Cavy Shrim (3)
AntonyGurk (1)
After command button pushing in my Bean I again have sequence:
Antony Gurk (1)
Beny Short (2)
Cavy Shrimk (3)
Code: Select all
<p:selectCheckboxMenu id="selectCheckboxMenu"
value="#{docBean.docIncomingEntity.selectedEntityList}"
style="min-width: 15rem"
multiple="true"
filter="true"
converter="omnifaces.SelectItemsConverter"
filterMatchMode="contains"
panelStyle="width: 30rem"
scrollHeight="250"
var="item">
<f:attribute name="collectionType" value="java.util.ArrayList"/>
<f:selectItems value="#{employeeBean.allEmployeeList}"
itemLabel="#{item.asName()}"
itemValue="#{item}"
var="item"/>
</p:selectCheckboxMenu>