ICE checkbox 用法
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 javax.faces.component.UISelectBoolean;
import javax.faces.event.PhaseId;
import javax.faces.event.ValueChangeEvent;
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 HtmlDataTable inventoryList;
private Fiche ficheSelectione;
private UISelectBoolean selectAllCheckbox;
private UISelectBoolean selectCheckbox;
private boolean selected;
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public UISelectBoolean getSelectAllCheckbox() {
return selectAllCheckbox;
}
public void setSelectAllCheckbox(UISelectBoolean selectAllCheckbox) {
this.selectAllCheckbox = selectAllCheckbox;
}
public UISelectBoolean getSelectCheckbox() {
return selectCheckbox;
}
public void setSelectCheckbox(UISelectBoolean 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 HtmlDataTable getInventoryList() {
return inventoryList;
}
public void setInventoryList(HtmlDataTable inventoryList) {
this.inventoryList = inventoryList;
}
public List<DossierMedical> getListDossier() {
return dossierMedicalService.getListDossierMedical();
}
public void setListDossier(List<DossierMedical> listDossier) {
this.listDossier = listDossier;
}
public String actTable() {
return "success";
}
public String updateDossier() {
ficheService.update(ficheSelectione);
return "success";
}
public void deleteDossier() {
ficheService.delete(ficheSelectione);
}
public void selectAll(ValueChangeEvent 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
本文来自博客园,作者:aspirant,转载请注明原文链接:https://www.cnblogs.com/aspirant/p/7419754.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?