import javax.faces.convert.FacesConverter;
import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
import org.mxchange.jcontactsbusiness.model.department.Department;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestBean;
-import org.mxchange.jjobs.beans.business.department.JobsDepartmentWebRequestController;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewBean;
+import org.mxchange.jjobs.beans.business.department.list.JobsDepartmentListWebViewController;
/**
* Converter for company department id <-> instance
/**
* Company department EJB
*/
- private static JobsDepartmentWebRequestController DEPARTMENT_CONTROLLER;
+ private static JobsDepartmentListWebViewController DEPARTMENT_LIST_CONTROLLER;
@Override
public Department getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Is the instance there?
- if (null == DEPARTMENT_CONTROLLER) {
- // Get bean from CDI directly
- DEPARTMENT_CONTROLLER = CDI.current().select(JobsDepartmentWebRequestBean.class).get();
- }
-
// Is the value null or empty?
if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
// Warning message
// Try to parse the value as long
final Long departmentId = Long.valueOf(submittedValue);
+ // Is the instance there?
+ if (null == DEPARTMENT_LIST_CONTROLLER) {
+ // Get bean from CDI directly
+ DEPARTMENT_LIST_CONTROLLER = CDI.current().select(JobsDepartmentListWebViewBean.class).get();
+ }
+
// Try to get user instance from it
- companyDepartment = DEPARTMENT_CONTROLLER.findDepartmentById(departmentId);
+ companyDepartment = DEPARTMENT_LIST_CONTROLLER.findDepartmentById(departmentId);
} catch (final NumberFormatException ex) {
// Throw again
throw new ConverterException(ex);