]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/converter/mobile/JobsMobileNumberConverter.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / converter / mobile / JobsMobileNumberConverter.java
index 1b23e1152078eb28676482011bf196d21b2fe894..8d237daf7bcf94e52879136da6a4ceee9ee64e57 100644 (file)
@@ -38,21 +38,12 @@ public class JobsMobileNumberConverter implements Converter<DialableMobileNumber
        /**
         * Phone EJB
         */
-       private static JobsPhoneWebRequestController PHONE_CONTROLLER;
+       private static JobsPhoneWebRequestController PHONE_LIST_CONTROLLER;
 
        @Override
        public DialableMobileNumber getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Is the instance there?
-               if (null == PHONE_CONTROLLER) {
-                       // Get bean from CDI directly
-                       PHONE_CONTROLLER = CDI.current().select(JobsPhoneWebRequestBean.class).get();
-               }
-
                // Is the value null or empty?
                if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Warning message
-                       // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
                        // Return null
                        return null;
                }
@@ -64,12 +55,18 @@ public class JobsMobileNumberConverter implements Converter<DialableMobileNumber
                        // Try to parse the value as long
                        final Long mobileNumberId = Long.valueOf(submittedValue);
 
+                       // Is the instance there?
+                       if (null == MOBILE_LIST_CONTROLLER) {
+                               // Get bean from CDI directly
+                               MOBILE_LIST_CONTROLLER = CDI.current().select(FinancialsMobileListWebViewBean.class).get();
+                       }
+
                        // Try to get mobile instance from it
-                       mobileNumber = PHONE_CONTROLLER.findMobileNumberById(mobileNumberId);
+                       mobileNumber = MOBILE_LIST_CONTROLLER.findMobileNumberById(mobileNumberId);
                } catch (final NumberFormatException ex) {
                        // Throw again
                        throw new ConverterException(ex);
-               } catch (final PhoneEntityNotFoundException ex) {
+               } catch (final MobileEntityNotFoundException ex) {
                        // Debug message
                        // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
                }
@@ -87,7 +84,7 @@ public class JobsMobileNumberConverter implements Converter<DialableMobileNumber
                }
 
                // Return id number
-               return String.valueOf(value.getPhoneId());
+               return String.valueOf(value.getMobileId());
        }
 
 }