我的页面中有一个 selectonemenu,我从我的支持 bean 中获取它的内容。但是selectonemenu的内容没有排序。这是代码......
<p:selectOneMenu id="Department" value="#{search.selectedDepartment}">
<f:selectItem itemLabel="Select Department" itemValue="" />
<f:selectItems value="#{search.departments}" />
</p:selectOneMenu>
还有我的豆...
public class SearchBean implements Serializable {
private Map<String, Map<String, String>> courseData = new HashMap<String, Map<String, String>>();
private Map<String, String> departments = new HashMap<String, String>();
private String selectedDepartment;
departments.put("department1",
"department1");
departments.put("department2",
"department2");
departments.put("department3", "department3");
departments.put("department4", "department4");
departments.put("department5", "department5");
//getters setters...
}
并且selectonemenu的内容分别不是department1,department2,department3,department4,department5,没有排序。