Communication between JSF and beans
Hi,
I am a JSF starter and I have a "best practice" question regarding lookups.
Assume a simple db design that has two tables, EMPLOYEE(EMP_ID, EMP_DEPTID) and DEPARTMENT (DEPT_ID, DEPT_NAME).
At the bean level we have two classes, Employee and Department.
class Employee {
int id;
Department department;
}
class Department {
int id;
String name;
}
At the JSF level we need a SelectOneMenu in order to pick the department for an employee. If we had a "deptid" in Employe, then this should be the "value" property of the select. But we have a whole object so what the value should be? How do you handle such a situation?
TIA
Denis

