Hello everybody,
I have a datable which contain multiple lines gotten from database, in the header of the datable i have a checkbox <ice:dataTable rows="10" id="inventoryList" value="#{Bordereau.listFiche}" var="item" binding="#{ModifierDM.inventoryList}"> .....I have many columns and the last one contains <ice:column> <f:facet name="header"> <ice:selectBooleanCheckbox id="selectAll" binding="#{ModifierDM.selectAllCheckbox}" valueChangeListener="#{ModifierDM.selectAll}" partialSubmit="true"/> </f:facet> <ice:selectBooleanCheckbox id="select" binding="#{ModifierDM.selectCheckbox}" /> </ice:column> </ice:dataTable> The purpose is to be able to check all checkboxes if i check the header's one. But nothing happen ! Here is my class package com.atos.him.beanManager; import java.util.List; import ; import ; import ; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.atos.him.entity.DossierMedical; import com.atos.him.entity.Fiche; import com.atos.him.services.DossierMedicalService; import com.atos.him.services.FicheService; import com.icesoft.faces.component.ext.HtmlDataTable; import com.icesoft.faces.component.ext.HtmlSelectBooleanCheckbox; public class ModifierDMBean { private DossierMedicalService dossierMedicalService; private FicheService ficheService; private inventoryList; private Fiche ficheSelectione; private selectAllCheckbox; private selectCheckbox; private boolean selected; public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } public getSelectAllCheckbox() { return selectAllCheckbox; } public void setSelectAllCheckbox( selectAllCheckbox) { this.selectAllCheckbox = selectAllCheckbox; } public getSelectCheckbox() { return selectCheckbox; } public void setSelectCheckbox( selectCheckbox) { this.selectCheckbox = selectCheckbox; } public Fiche getFicheSelectione() { return ficheSelectione; } public void setFicheSelectione(Fiche ficheSelectione) { this.ficheSelectione = ficheSelectione; } @SuppressWarnings("unused") private List<Fiche> listFiche; @SuppressWarnings("unused") private List<DossierMedical> listDossier; public ModifierDMBean() { ApplicationContext appc = new ClassPathXmlApplicationContext( "applicationContext.xml"); setDossierMedicalService((DossierMedicalService) appc .getBean("dossierMedicalService")); setFicheService((FicheService) appc.getBean("ficheService")); } public DossierMedicalService getDossierMedicalService() { return dossierMedicalService; } public void setDossierMedicalService( DossierMedicalService dossierMedicalService) { this.dossierMedicalService = dossierMedicalService; } public FicheService getFicheService() { return ficheService; } public void setFicheService(FicheService ficheService) { this.ficheService = ficheService; } public List<Fiche> getListFiche() { return ficheService.getListfiche(); } public void setListFiche(List<Fiche> listFiche) { this.listFiche = listFiche; } public getInventoryList() { return inventoryList; } public void setInventoryList( inventoryList) { this.inventoryList = inventoryList; } public List<DossierMedical> getListDossier() { return dossierMedicalService.getListDossierMedical(); } public void setListDossier(List<DossierMedical> listDossier) { this.listDossier = listDossier; } public actTable() { return "success"; } public String updateDossier() { ficheService.update(ficheSelectione); return "success"; } public void deleteDossier() { ficheService.delete(ficheSelectione); } public void selectAll( e) { if (!e.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) { e.setPhaseId(PhaseId.INVOKE_APPLICATION); e.queue(); return; } selectCheckbox.setValue(true); selected = true; } } am waiting your answers
https://coderanch.com/t/538212/java/checkAll-Multiple-checkbox-datatable-IceFaces