所以,这里是 jsf 组件:
<h:selectBooleanCheckbox id="cb#{index}" value="backingBean.value" />
这是支持bean java的一部分:
/**
* getValue is a method which checks if a checkbox is selected or not, using the checkbox ID
*/
public boolean getValue() {
//TODO: get the checkbox id
String checkboxID = ??
if (getCheckedIDs().contains(checkboxID)) {
return true;
}
return false;
}
当页面加载复选框时,我想以这种方式检查复选框是否被选中。所以问题是,写什么而不是?获取调用该方法的复选框的 ID?我只能使用 JSF 1.1,这一点非常重要,因此有许多解决方案不适用于此版本。