mport javax.faces.model.SelectItem;
import javax.faces.model.SelectItemGroup;
public class FileItemsBean {
/**
* 规范性文件
*/
private SelectItem[] ruleFile = {
new SelectItem("条例","条例"),
new SelectItem("规定","规定")
};
/**
* 领导指导性文件
*/
private SelectItem[] leaderFile = {
new SelectItem("决议","决议"),
new SelectItem("决定","决定"),
new SelectItem("指示","指示"),
new SelectItem("意见","意见"),
new SelectItem("通知","通知"),
new SelectItem("通报","通报"),
new SelectItem("批复","批复")
};
/**
* 会议文件
*/
private SelectItem[] meetFile = {
new SelectItem("会议纪要","会议纪要")
};
/**
* 公布性文件
*/
private SelectItem[] pubFile = {
new SelectItem("公报","公报")
};
/**
* 陈述呈请性文件
*/
private SelectItem[] stateFile = {
new SelectItem("报告","报告"),
new SelectItem("请示","请示")
};
/**
* 商洽性文件
*/
private SelectItem[] bussFile = {
new SelectItem("函","函")
};
private SelectItemGroup ruleFileGroup = new SelectItemGroup("规范性文件","ruleFileGroup",false,ruleFile);
private SelectItemGroup leaderFileGroup = new SelectItemGroup("领导指导性文件","leaderFileGroup",false,leaderFile);
private SelectItemGroup meetFileGroup = new SelectItemGroup("会议文件","meetFileGroup",false,meetFile);
private SelectItemGroup pubFileGroup = new SelectItemGroup("公布性文件","pubFileGroup",false,pubFile);
private SelectItemGroup stateFileGroup = new SelectItemGroup("陈述呈请性文件","stateFileGroup",false,stateFile);
private SelectItemGroup bussFileGroup = new SelectItemGroup("商洽性文件","bussFileGroup",false,bussFile);
private SelectItem[] groups = {
ruleFileGroup,leaderFileGroup,meetFileGroup,pubFileGroup,stateFileGroup,bussFileGroup
};
public SelectItem[] getGroups() {
return groups;
}
public void setGroups(SelectItem[] groups) {
this.groups = groups;
};
}
<h:outputLabel for="fileType" value="文档类别" />
<f:verbatim> </f:verbatim>
<h:selectOneMenu id="fileType" value="#{fileRepBean.fileRep.fileType}"
required="true" style="width:154px;">
<f:selectItem itemValue="" itemLabel="请选择"/>
<f:selectItems value="#{FileItemsBean.groups}"/>
</h:selectOneMenu>