How to use some of enum values in selectItem of selectOneRadio in Jsf

192 views Asked by At

I have an old project to implement some tasks but i'm not sure how to make it. jsff file i want to put some of the enum values as select item of oneRadio I found some answers but all of them shows how to add list of each enum value but i want to show only two out of three value

public enum DepartmentEnum{
  public enum SaEnum {
    E_DEP1("E_DEP1"), 
    E_DEP2("E_DEP2"), 
    E_DEP3("E_DEP3");

    private String dep;

    SaEnum(String dep) {
        this.dep= dep;
    }

    public String getDep() {
        return dep;
    }

    public boolean eq(String dep) {
        return Objects.nonNull(dep) && this.getDep().equals(dep);
    }
}

I only want to show dep2 and dep3 in this condition but i couldn't make it

<af:column id="clDepartment" headerText="Department" width="%5" rendered="#{bean.isSection2}" noWrap="false">
  <af:selectOneRadio id="otType" value="#{row.employee.dep}">
    <f:selectItem itemValue="#{bean.depEnum[1]}" itemLabel="Dep2"/>
    <f:selectItem itemValue="#{bean.depEnum.get(2)}" itemLabel="Dep3"/>
  </af:selectOneRadio>
</af:column>
0

There are 0 answers