From b4a045228273ec0b20ccd016b81f9ef13877acb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 28 Oct 2017 18:36:59 +0200 Subject: [PATCH] Maybe cherry-pick: - added taglib for jproduct - added input panel-grid JSF widget for entering product prices with taxes, net and gross price MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../FinancialAdminProductWebRequestBean.java | 25 ++++++++++- web/WEB-INF/product.jsf.taglib.xml | 41 ++++++++++++++++++ .../product_price_input_panel_grid.tpl | 43 +++++++++++++++++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 web/WEB-INF/product.jsf.taglib.xml create mode 100644 web/WEB-INF/resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl diff --git a/src/java/org/mxchange/jfinancials/beans/product/FinancialAdminProductWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/product/FinancialAdminProductWebRequestBean.java index e212f615..db8058be 100644 --- a/src/java/org/mxchange/jfinancials/beans/product/FinancialAdminProductWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/product/FinancialAdminProductWebRequestBean.java @@ -63,6 +63,11 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl */ private Category productCategory; + /** + * Product's price currency code like EUR or USD + */ + private String productCurrencyCode; + /** * Product's gross price */ @@ -160,6 +165,24 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl this.productCategory = productCategory; } + /** + * Getter for product's price currency code + *

+ * @return Product's price currency code + */ + public String getProductCurrencyCode () { + return this.productCurrencyCode; + } + + /** + * Setter for product's price currency code + *

+ * @param productCurrencyCode Product's price currency code + */ + public void setProductCurrencyCode (final String productCurrencyCode) { + this.productCurrencyCode = productCurrencyCode; + } + /** * Getter for product's gross price *

@@ -251,7 +274,7 @@ public class FinancialAdminProductWebRequestBean extends BaseFinancialsBean impl */ private Product createProductInstance () { // Create product instance - final Product product = new GenericProduct(this.getProductTitle(), this.getProductGrossPrice(), this.getProductCategory(), this.getProductAvailability()); + final Product product = new GenericProduct(this.getProductTitle(), this.getProductGrossPrice(), this.getProductCurrencyCode(), this.getProductCategory(), this.getProductAvailability()); // Set all optional fields product.setProductNetPrice(this.getProductNetPrice()); diff --git a/web/WEB-INF/product.jsf.taglib.xml b/web/WEB-INF/product.jsf.taglib.xml new file mode 100644 index 00000000..c59492d0 --- /dev/null +++ b/web/WEB-INF/product.jsf.taglib.xml @@ -0,0 +1,41 @@ + + + + http://mxchange.org/jsf/jproduct/widgets + + inputProductPricePanelGrid + This tag renders input fields for creating a price panel grid for product prices. + resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl + + rendered + Whether this tag is being rendered by JSF engine (default: true). + false + java.lang.Boolean + + + targetController + A target backing bean (EL code resolving into it) extending at least BaseFacesBean where to set the data in. + true + + org.mxchange.jcoreee.bean.faces.BaseFacesBean + + + diff --git a/web/WEB-INF/resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl b/web/WEB-INF/resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl new file mode 100644 index 00000000..158d257c --- /dev/null +++ b/web/WEB-INF/resources/tags/input/panel_grid/product/product_price_input_panel_grid.tpl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + -- 2.39.5