0
我只想列出使用冰面在下拉列表中的數據庫中的員工姓名列表。任何人都可以建議我如何在icefaces頁面中編寫查詢以獲取數據庫中的員工列表。說表名是「員工」。如何從icefaces中的數據庫中獲取下拉列表中的值?
在此先感謝。
我只想列出使用冰面在下拉列表中的數據庫中的員工姓名列表。任何人都可以建議我如何在icefaces頁面中編寫查詢以獲取數據庫中的員工列表。說表名是「員工」。如何從icefaces中的數據庫中獲取下拉列表中的值?
在此先感謝。
我這樣做。 在bean致電您的商戶類 e.g:
ArrayList<SelectItem> selectEmployees = new ArrayList<SelectItem>();
ArrayList<Employee> employees = company.getEmployees(); //this one calls the EmployeeDAO to get the records from database.
for(int i = 0; i < employees.size(); i++){
selectEmployees.add(new SelectItem(employes.get(i).getId(),employees.get(i).getName));
}
現在你可以使用selectEmployees作爲selectOneMenu用於價值。