From: Roland Häder Date: Sun, 2 Oct 2022 11:53:45 +0000 (+0200) Subject: Product-only: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b730da3ab75d618a6c13568b6deb63408dc6a190;p=jfinancials-war.git Product-only: - bypassDuplicateI18nKey can be NULL when not set in JSF tag --- diff --git a/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java b/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java index 4a18fb55..4fa2ba38 100644 --- a/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/generic_product/FinancialsGenericProductValidator.java @@ -82,6 +82,12 @@ public class FinancialsGenericProductValidator extends BaseStringValidator { PRODUCT_LIST_CONTROLLER = CDI.current().select(FinancialsProductListWebViewBean.class).get(); } + // Is bypassDuplicateI18nKey set? + if (null == this.bypassDuplicateI18nKey) { + // By default is not bypass + this.setBypassDuplicateI18nKey(Boolean.FALSE); + } + // Check, if the name has already been used if (!this.bypassDuplicateI18nKey && PRODUCT_LIST_CONTROLLER.isProductI18nKeyAdded((String) productI18nKey)) { // Create message diff --git a/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java b/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java index 307fbadb..0283c04c 100644 --- a/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/product_category/FinancialsProductCategoryValidator.java @@ -82,6 +82,12 @@ public class FinancialsProductCategoryValidator extends BaseStringValidator { CATEGORY_LIST_CONTROLLER = CDI.current().select(FinancialsCategoryListWebViewBean.class).get(); } + // Is bypassDuplicateI18nKey set? + if (null == this.bypassDuplicateI18nKey) { + // By default is not bypass + this.setBypassDuplicateI18nKey(Boolean.FALSE); + } + // Check, if the name has already been used if (!this.bypassDuplicateI18nKey && CATEGORY_LIST_CONTROLLER.isCategoryI18nKeyAdded((String) categoryI18nKey)) { // Create message