From: Roland Häder Date: Sat, 28 Oct 2017 16:36:59 +0000 (+0200) Subject: Maybe cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b4a045228273ec0b20ccd016b81f9ef13877acb0;p=jfinancials-war.git Maybe cherry-pick: - added taglib for jproduct - added input panel-grid JSF widget for entering product prices with taxes, net and gross price Signed-off-by: Roland Häder --- 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 @@ + + + + + + + + + + + + + + + +