SelectCheckboxMenu sequence of selected items not kept

UI Components for JSF
Post Reply
jiny10
Posts: 13
Joined: 25 May 2020, 20:33

05 Sep 2022, 21:47

Hello,

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>
                                

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

11 Sep 2022, 15:23

This has been asked for as an enhancement already: https://github.com/primefaces/primefaces/issues/8119
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

jiny10
Posts: 13
Joined: 25 May 2020, 20:33

12 Sep 2022, 12:14

Thank you for your answer, but do you now when approximately Prime Faces Team is going to implement this issue or improve this bug?

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

12 Sep 2022, 14:01

no plans from our side to work on it
but you can work on a PR or sponsor it via PrimeFaces PRO
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests