From 3aba8bc72a25beb5d0baf0d36a643bf38ac2c2bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 23 Apr 2020 03:29:33 +0200 Subject: [PATCH] Don't cherry-pick: - some renderFoo() methods have extra parameters, added - in converters/validators now the FOO_LIST_CONTROLLER static instance shall always be initialized directly before the try{} block MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../receipt/FinancialsReceiptConverter.java | 12 ++++++------ .../receipt/admin_form_financial_receipt.tpl | 6 +++--- .../admin_form_financial_receipt_item.tpl | 2 +- .../receipt/login_form_financial_receipt.tpl | 4 ++-- web/admin/financial/receipt/admin_receipt_list.xhtml | 12 ++++++------ .../receipt_item/admin_receipt_item_list.xhtml | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java b/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java index a649e483..37686d9f 100644 --- a/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java +++ b/src/java/org/mxchange/jfinancials/converter/financial/receipt/FinancialsReceiptConverter.java @@ -42,12 +42,6 @@ public class FinancialsReceiptConverter implements Converter { @Override public BillableReceipt getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) { - // Is the instance there? - if (null == RECEIPT_LIST_CONTROLLER) { - // Get bean from CDI directly - RECEIPT_LIST_CONTROLLER = CDI.current().select(FinancialsReceiptListWebViewBean.class).get(); - } - // Is the value null or empty? if ((null == submittedValue) || (submittedValue.trim().isEmpty())) { // Warning message @@ -60,6 +54,12 @@ public class FinancialsReceiptConverter implements Converter { // Init instance BillableReceipt receipt = null; + // Is the instance there? + if (null == RECEIPT_LIST_CONTROLLER) { + // Get bean from CDI directly + RECEIPT_LIST_CONTROLLER = CDI.current().select(FinancialsReceiptListWebViewBean.class).get(); + } + try { // Try to parse the value as long final Long receiptId = Long.valueOf(submittedValue); diff --git a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl index ab4331bb..4d2486c1 100644 --- a/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl +++ b/web/WEB-INF/templates/admin/financial/receipt/admin_form_financial_receipt.tpl @@ -34,7 +34,7 @@ value="#{branchOfficeListController.allBranchOffices}" var="branchOffice" itemValue="#{branchOffice}" - itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" + itemLabel="#{beanHelper.renderBranchOffice(branchOffice, false)}" /> @@ -91,8 +91,8 @@ value="#{employeeListController.allEmployees}" var="employee" itemValue="#{employee}" - itemLabel="#{beanHelper.renderEmployee(employee)}" - itemDescription="#{beanHelper.renderBasicData(employee.employeeBasicData, true)}, #{beanHelper.renderBranchOffice(employee.employeeBranchOffice)}" + itemLabel="#{beanHelper.renderEmployee(employee, false)}" + itemDescription="#{beanHelper.renderBasicData(employee.employeeBasicData, true, true)}, #{beanHelper.renderBranchOffice(employee.employeeBranchOffice, true)}" /> diff --git a/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl b/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl index 4d9d0815..18ff60be 100644 --- a/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl +++ b/web/WEB-INF/templates/admin/financial/receipt_item/admin_form_financial_receipt_item.tpl @@ -74,7 +74,7 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData, true)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}" /> diff --git a/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl b/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl index ad8f0985..904cbcf7 100644 --- a/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl +++ b/web/WEB-INF/templates/user/financial/receipt/login_form_financial_receipt.tpl @@ -36,7 +36,7 @@ value="#{branchOfficeListController.allBranchOffices}" var="branchOffice" itemValue="#{branchOffice}" - itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" + itemLabel="#{beanHelper.renderBranchOffice(branchOffice, false)}" /> @@ -93,7 +93,7 @@ value="#{employeeListController.allEmployees}" var="companyHeadquarter" itemValue="#{companyEmployee}" - itemLabel="#{beanHelper.renderEmployee(companyEmployee)}" + itemLabel="#{beanHelper.renderEmployee(companyEmployee, false)}" /> diff --git a/web/admin/financial/receipt/admin_receipt_list.xhtml b/web/admin/financial/receipt/admin_receipt_list.xhtml index 62cb94ed..01c19fe9 100644 --- a/web/admin/financial/receipt/admin_receipt_list.xhtml +++ b/web/admin/financial/receipt/admin_receipt_list.xhtml @@ -133,14 +133,14 @@ value="#{branchOfficeListController.allBranchOffices}" var="branchOffice" itemValue="#{branchOffice}" - itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" + itemLabel="#{beanHelper.renderBranchOffice(branchOffice, false)}" /> @@ -170,14 +170,14 @@ value="#{employeeListController.allEmployees}" var="employee" itemValue="#{employee}" - itemLabel="#{beanHelper.renderEmployee(employee)}" + itemLabel="#{beanHelper.renderEmployee(employee, false)}" /> @@ -346,7 +346,7 @@ @@ -355,7 +355,7 @@ diff --git a/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml b/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml index a25f9e32..d0680bb1 100644 --- a/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml +++ b/web/admin/financial/receipt_item/admin_receipt_item_list.xhtml @@ -192,14 +192,14 @@ value="#{basicDataListController.allBasicData}" var="basicData" itemValue="#{basicData}" - itemLabel="#{beanHelper.renderBasicData(basicData, true)}" + itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}" /> -- 2.39.5