0

I am using selectCheckboxMenu from primefaces, but i need to know which item was checked here is my code:

<p:selectCheckboxMenu
                            label=""
                            id="cboBiblioteca" 
                            filter="true" filterMatchMode="contains"
                            required="false"
                            widgetVar="cboBiblioteca"
                            value="#{documentalBean.sbiblioteca}"
                            style="width:20px">
                            <p:ajax event="change" listener="#{documentalBean.checkBiblioteca()}"/>
                            <f:selectItems value="#{bibliotecaBean.bibliotecas}" var="biblioteca"  itemLabel="#{biblioteca.NOMBRE_BIBLIOTECA.toLowerCase()}" itemValue="#{biblioteca.ID_BIBLIOTECA_MEDIADOR}"/>
                        </p:selectCheckboxMenu>

my "sbiblioteca" array is a String array, when i whatch it on the debugger i cant get the last checked, because they arent added to the last they are added according to their position in the list.

1 Answers1

0

Store the 'last -1' list and compare with the 'last'... Simple... Just like you would in plain java... See differences between two arrays

Community
  • 1
  • 1
Kukeltje
  • 12,223
  • 4
  • 24
  • 47