jeudi 19 mai 2016

Primefaces selectCheckboxMenu how to get the last checked item

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.




Aucun commentaire:

Enregistrer un commentaire