NO=Nein
PARENT_CATEGORY_CANNOT_BE_NULL=Elternkategorie darf nicht leer sein.
CATEGORY_MUST_BE_SELECTED=Es muss eine Kategorie ausgewaehlt werden.
-ITEM_AMOUNT_IS_REQUIRED=Bestellmenge wird benoetigt.
+ERROR_AMOUNT_IS_NULL=Die Bestellmenge ist nicht gesetzt.
+BUTTON_TITLE_ADD_ITEM_TO_BASKET=F\u00fcgt das Produkt dem Warenkorb hinzu.
+INPUT_TITLE_ENTER_ITEM_AMOUNT=Geben Sie hier die Bestellmenge ein.
GENDER_COMPANY=Company
MiniBasketTag.basket_is_empty=The basket is empty.
MiniBasketTag.last_item=Last added item: {0}
-MiniBasketTag.additional_items=There are {0} items in the basket.
+MiniBasketTag.additional_items=There are {0} items in the basketController.
MiniBasketTag.to_basket=To basket
MiniBasketTag.header=Basket
CATEGORY_HAS_NO_PARENT=No parent category
NO=No
PARENT_CATEGORY_CANNOT_BE_NULL=Parent category cannot be empty.
CATEGORY_MUST_BE_SELECTED=You have to select a category.
-ITEM_AMOUNT_IS_REQUIRED=Order amount is required.
+ERROR_AMOUNT_IS_NULL=Order amount is not set.
+BUTTON_TITLE_ADD_ITEM_TO_BASKET=Adds the product to the basket.
+INPUT_TITLE_ENTER_ITEM_AMOUNT=Enter order amount here.
*/
package org.mxchange.pizzaapplication.beans.basket;
+import java.util.Map;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.faces.FacesException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
import org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException;
import org.mxchange.jshopcore.model.basket.AddableBasketItem;
+import org.mxchange.jshopcore.model.basket.Basket;
import org.mxchange.jshopcore.model.basket.BasketSessionBeanRemote;
+import org.mxchange.jshopcore.model.basket.ShopBasket;
import org.mxchange.jshopcore.model.item.BasketItem;
import org.mxchange.jshopcore.model.product.Product;
*
* @author Roland Haeder<roland@mxchange.org>
*/
-@Named ("basket")
+@Named ("basketController")
@SessionScoped
public class BasketWebBean extends BaseFrameworkBean implements BasketWebController {
private static final long serialVersionUID = 5_476_347_320_198L;
/**
- * Basket bean
+ * Ordered amount
*/
- private final BasketSessionBeanRemote basketBean;
+ private Long amount;
/**
- * Ordered amount
+ * Instance of wrapped basket
*/
- private Long amount;
+ private final Basket<AddableBasketItem> basket;
+
+ /**
+ * Basket bean
+ */
+ private final BasketSessionBeanRemote basketBean;
/**
* Current item
// Get initial context
InitialContext context = new InitialContext();
+ // Get new application instance
+ this.basket = new ShopBasket();
+
// Try to lookup
this.basketBean = (BasketSessionBeanRemote) context.lookup("ejb/stateless-basket"); //NOI18N
}
+ @Override
+ public String addItem (final Product product) {
+ // Generate item instance
+ AddableBasketItem item = new BasketItem(product, this.getAmount());
+
+ // Is amount set?
+ if (this.getAmount() == null) {
+ // No amount specified?!
+ return null;
+ }
+
+ try {
+ // item should not be null
+ if (null == item) {
+ // Abort here
+ throw new NullPointerException("item is null"); //NOI18N
+ }
+
+ // Deligate to model
+ this.basket.addItem(item);
+
+ // Remove amount
+ this.setAmount(null);
+
+ // Added
+ return "item_added"; //NOI18N
+ } catch (final BasketItemAlreadyAddedException ex) {
+ // Throw unchecked exception
+ throw new FacesException(ex);
+ }
+ }
+
@Override
public Float calculateItemPrice () {
// Is the current item/amount set?
public Long getAmount () {
return this.amount;
}
-
+
@Override
public void setAmount (final Long amount) {
this.amount = amount;
}
@Override
- public boolean isProductAdded (final Product product) {
- // Must not be null
- if (null == product) {
- // Abort here
- throw new NullPointerException("product is null"); //NOI18N
- }
+ public AddableBasketItem getCurrentItem () {
+ return this.currentItem;
+ }
- // Generate fake instance
- AddableBasketItem item = new BasketItem(product);
+ @Override
+ public void setCurrentItem (final AddableBasketItem currentItem) {
+ this.currentItem = currentItem;
+ }
- // Ask bean about it
- return this.getBasketBean().isAdded(item);
+ @Override
+ public AddableBasketItem getLast () {
+ // Deligate to basket instance
+ return this.basket.getLast();
}
@Override
- public boolean isEmpty () {
- // Check local "cache"
- return this.getBasketBean().isEmpty();
+ public int getLastNumRows () {
+ // Deligate to basket instance
+ return this.basket.getLastNumRows();
}
@Override
}
@PostConstruct
- public void init () throws RuntimeException {
- // Call super init first
+ public void init () {
+ // Call generic init first
super.genericInit();
}
+ @Override
+ public boolean isEmpty () {
+ // Deligate to basket instance
+ return this.basket.isEmpty();
+ }
+
+ @Override
+ public boolean isProductAdded (final Product product) {
+ // Must not be null
+ if (null == product) {
+ // Abort here
+ throw new NullPointerException("product is null"); //NOI18N
+ }
+
+ // Generate fake instance
+ AddableBasketItem fake = new BasketItem(product);
+
+ // Ask bean about it
+ boolean isAdded = this.basket.isAdded(fake);
+
+ // Is it added?
+ if (isAdded) {
+ // Get item
+ AddableBasketItem item = this.getItemFromProduct(product);
+
+ // Set this as current item
+ this.setCurrentItem(item);
+ }
+
+ // Return status
+ return isAdded;
+ }
+
/**
* Getter for basket bean instance
*
return this.basketBean;
}
- @Override
- public String addItem (final Product product) {
- // Generate item instance
- AddableBasketItem item = new BasketItem(product);
-
- // Is amount set?
- if (this.getAmount() == null) {
- // No amount specified?!
- return null;
+ /**
+ * Somewhat getter for an item instance from given product instance. This
+ * method returns null if no item was found to given product. The product is
+ * found by checking it's id and itemType=product
+ *
+ * @param product Product instance
+ * @return Item instance or null if not found
+ */
+ private AddableBasketItem getItemFromProduct (final Product product) {
+ // Product must not be null
+ if (null == product) {
+ // Abort here
+ throw new NullPointerException("product is null"); //NOI18N
}
- // Set amount
- item.setAmount(this.getAmount());
+ // Create item instance
+ AddableBasketItem foundItem = null;
- try {
- // Handle it to bean
- this.getBasketBean().addItem(item);
+ // Create fake instance
+ AddableBasketItem fake = new BasketItem(product);
- // Add item to local basket, too
- //this.basket.addItem(item);
+ // Get all items
+ Map<Long, AddableBasketItem> map = this.basket.getAll();
- // Remove amount
- this.setAmount(null);
+ // Check all entries
+ for (Map.Entry<Long, AddableBasketItem> entrySet : map.entrySet()) {
+ // Get item
+ AddableBasketItem item = entrySet.getValue();
- // Added
- return "item_added"; //NOI18N
- } catch (final BasketItemAlreadyAddedException ex) {
- // Throw unchecked exception
- throw new FacesException(ex);
- }
- }
+ // item must not be null
+ if (null == item) {
+ // Abort here
+ throw new NullPointerException("item is null"); //NOI18N
+ }
- @Override
- public AddableBasketItem getCurrentItem () {
- return this.currentItem;
- }
+ // Is it the same?
+ if (item.equals(fake)) {
+ // Set found item and abort look
+ foundItem = item;
+ break;
+ }
+ }
- @Override
- public void setCurrentItem (final AddableBasketItem currentItem) {
- this.currentItem = currentItem;
+ // Return it
+ return foundItem;
}
}
* @return Current item's total price
*/
public Float calculateItemPrice ();
+
+ /**
+ * Getter for last entry
+ *
+ * @return Last added item in basket
+ */
+ public AddableBasketItem getLast ();
+
+ /**
+ * Getter for last num rows
+ *
+ * @return Last num rows
+ */
+ public int getLastNumRows ();
}
import javax.enterprise.context.RequestScoped;
import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
import javax.inject.Named;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jshopcore.model.category.Category;
import org.mxchange.jshopcore.model.category.CategorySessionBeanRemote;
import org.mxchange.jshopcore.model.category.ProductCategory;
+import org.mxchange.pizzaapplication.beans.controller.ShopWebController;
/**
* Main application class
@RequestScoped
public class AdminCategoryWebBean extends BaseFrameworkBean implements AdminCategoryWebController {
/**
- * Serial id
+ * Serial number
*/
private static final long serialVersionUID = 5_819_375_183_472_871L;
*/
private final CategorySessionBeanRemote categoryBean;
+ /**
+ * Shop bean
+ */
+ @Inject
+ private ShopWebController controller;
+
/**
* Category title
*/
category.setParentId(this.getParentId());
category.setTitle(this.getTitle());
- // Deligate to bean
+ // Deligate to remote bean
this.categoryBean.doAdminAddCategory(category);
+
+ // Also send it to the controller bean
+ this.controller.addCategory(category);
} catch (final CategoryTitleAlreadyUsedException ex) {
// Continue to throw
throw new FaceletException(ex);
import java.util.Deque;
import java.util.Queue;
import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.ApplicationScoped;
import javax.faces.FacesException;
import javax.faces.view.facelets.FaceletException;
import javax.inject.Named;
* @author Roland Haeder<roland@mxchange.org>
*/
@Named("controller")
-@SessionScoped
+@ApplicationScoped
public class ShopWebBean extends BaseFrameworkBean implements ShopWebController {
/**
- * Serial id
+ * Serial number
*/
private static final long serialVersionUID = 58_137_539_530_279L;
/**
- * Remote bean for categories
+ * "Cache" for all available products
*/
- private final CategorySessionBeanRemote categoryBean;
+ private Deque<Product> availableProducts;
/**
- * Remote bean for products
+ * All categories
*/
- private final ProductSessionBeanRemote productBean;
+ private Deque<Category> categories;
- /**
- * Default constructor
- *
- * @throws javax.naming.NamingException Something happened here?
- */
- public ShopWebBean () throws NamingException {
- // Get initial context
- InitialContext context = new InitialContext();
+ @Override
+ public void addCategory (final Category category) {
+ // Add the category
+ this.categories.add(category);
+ }
+
+ @Override
+ public void addProduct (final Product product) {
+ // Is the product available?
+ if (product.getAvailable()) {
+ // Add it
+ this.availableProducts.add(product);
+ }
+ }
+
+ @PostConstruct
+ public void init () {
+ // Call super init for getting resource bundle
+ super.genericInit();
- // Try to lookup the bean
- this.categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N
+ try {
+ // Get initial context
+ InitialContext context = new InitialContext();
- // Try to lookup the bean
- this.productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N
+ // Try to lookup the bean
+ CategorySessionBeanRemote categoryBean = (CategorySessionBeanRemote) context.lookup("ejb/stateless-category"); //NOI18N
+
+ // Get all categories
+ this.categories = categoryBean.getAllCategories();
+
+ // Try to lookup the bean
+ ProductSessionBeanRemote productBean = (ProductSessionBeanRemote) context.lookup("ejb/stateless-product"); //NOI18N
+
+ // Get available products list
+ this.availableProducts = productBean.getAvailableProducts();
+ } catch (final NamingException e) {
+ // Continued to throw
+ throw new FacesException(e);
+ }
}
@Override
public Deque<Category> getAllCategories () throws FacesException {
- // Get List back
- Deque<Category> deque = this.getCategoryBean().getAllCategories();
-
// Return it
- return deque;
+ // TODO Find something better here to prevent warning
+ return this.categories;
}
@Override
@Override
public Queue<Product> getAvailableProducts () throws FacesException {
- // Get queue from bean
- Queue<Product> queue = this.getProductBean().getAvailableProducts();
-
// Return it
- return queue;
- }
-
- @PostConstruct
- public void init () {
- // Call super init for getting resource bundle
- super.genericInit();
- }
-
- /**
- * Getter for shop remote bean
- *
- * @return Remote shop bean
- */
- private CategorySessionBeanRemote getCategoryBean () {
- return this.categoryBean;
- }
-
- /**
- * Getter for shop remote bean
- *
- * @return Remote shop bean
- */
- private ProductSessionBeanRemote getProductBean () {
- return this.productBean;
+ // TODO Find something better here to prevent warning
+ return this.availableProducts;
}
}
*/
public interface ShopWebController extends Serializable {
+ /**
+ * Adds given category to the "cached" instance
+ *
+ * @param category Category instance
+ */
+ public void addCategory (final Category category);
+
+ /**
+ * Adds given product to the "cached" instance
+ *
+ * @param product Product instance
+ */
+ public void addProduct (final Product product);
+
/**
* Some "getter" for a linked list of only available products
*
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import org.mxchange.jcore.model.contact.gender.Gender;
-import org.mxchange.jcore.model.contact.gender.GenderSessionBeanRemote;
+import org.mxchange.jcore.model.contact.gender.GenderUtils;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
/**
*/
private static final long serialVersionUID = 835_482_364_189L;
- /**
- * Remote bean
- */
- private final GenderSessionBeanRemote genderBean;
-
/**
* Default constructor
- *
- * @throws javax.naming.NamingException If something happens?
*/
- public GenderWebBean () throws NamingException {
- // Get initial context
- InitialContext context = new InitialContext();
-
- // Try to lookup bean
- this.genderBean = (GenderSessionBeanRemote) context.lookup("ejb/stateful-gender"); //NOI18N
+ public GenderWebBean () {
}
@Override
public Gender[] getAllGenders () {
// Return it
- return this.getGenderBean().allGenders();
+ return Gender.values();
}
@Override
public List<Gender> getSelectableGenders () {
// Init array
// TODO Call EJB here?
- List<Gender> genders = this.getGenderBean().selectableGenders();
+ List<Gender> genders = GenderUtils.selectableGenders();
// Return it
return genders;
}
-
- /**
- * Getter for data remote bean
- *
- * @return data remote bean
- */
- private GenderSessionBeanRemote getGenderBean () {
- return this.genderBean;
- }
}
import java.util.Deque;
import javax.enterprise.context.RequestScoped;
import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
import javax.inject.Named;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.mxchange.jcoreee.beans.BaseFrameworkBean;
+import org.mxchange.jshopcore.exceptions.CannotAddProductException;
import org.mxchange.jshopcore.exceptions.ProductTitleAlreadyUsedException;
import org.mxchange.jshopcore.model.product.GenericProduct;
import org.mxchange.jshopcore.model.product.Product;
import org.mxchange.jshopcore.model.product.ProductSessionBeanRemote;
+import org.mxchange.pizzaapplication.beans.controller.ShopWebController;
/**
* Main application class
public class AdminProductWebBean extends BaseFrameworkBean implements AdminProductWebController {
/**
- * Serial id
+ * Serial number
*/
private static final long serialVersionUID = 5_819_375_183_472_871L;
*/
private final ProductSessionBeanRemote productBean;
+ /**
+ * Shop bean
+ */
+ @Inject
+ private ShopWebController controller;
+
/**
* Property title
*/
// Call bean
this.productBean.doAdminAddProduct(product);
+ // Add to shop controller
+ this.controller.addProduct(product);
+
// Set all to null
this.setAvailable(Boolean.FALSE);
this.setId(null);
this.setPrice(null);
this.setTitle(null);
- } catch (final ProductTitleAlreadyUsedException ex) {
+ } catch (final ProductTitleAlreadyUsedException | CannotAddProductException ex) {
// Continue to throw
throw new FaceletException(ex);
}
<validator-id>NameValidator</validator-id>
<validator-class>org.mxchange.jcoreee.validator.string.names.NameValidator</validator-class>
</validator>
+ <validator>
+ <validator-id>ItemAmountValidator</validator-id>
+ <validator-class>org.mxchange.jcoreee.validator.number.item_amount.ItemAmountValidator</validator-class>
+ </validator>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
</navigation-case>
<navigation-case>
<from-outcome>basket</from-outcome>
- <to-view-id>/basket.xhtml</to-view-id>
+ <to-view-id>/basketController.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
- <context-root>/PizzaService-war</context-root>
- <class-loader delegate="true"/>
- <jsp-config>
- <property name="keepgenerated" value="true">
- <description>Keep a copy of the generated servlet class' java code.</description>
- </property>
- </jsp-config>
+ <context-root>/PizzaService-war</context-root>
+ <class-loader delegate="true"/>
+ <jsp-config>
+ <property name="keepgenerated" value="true">
+ <description>Keep a copy of the generated servlet class' java code.</description>
+ </property>
+ </jsp-config>
</glassfish-web-app>
<div class="mini_basket_box">
<div class="mini_basket_header">
- #{msg.mini_basket.header}
+ #{msg.mini_basketController.header}
</div>
<div class="mini_basket_last">
- #{msg.mini_basket.last_item}
+ #{msg.mini_basketController.last_item}
</div>
<div class="mini_basket_more">
- #{msg.mini_basket.additional_items}
+ #{msg.mini_basketController.additional_items}
</div>
<div class="mini_basket_link">
- <h:link id="to_basket" outcome="basket" title="#{msg.mini_basket.to_basket}" value="#{msg.mini_basket.to_basket}" />
+ <h:link id="to_basket" outcome="basket" title="#{msg.mini_basketController.to_basket}" value="#{msg.mini_basketController.to_basket}" />
</div>
</div>
</ui:composition>
<ui:define name="title"><ui:insert name="guest_title" class="guest_title" /></ui:define>
<!--
- Show basket if it contains items, else show an empty basket.
+ Show basket if it contains items, else show an empty basketController.
//-->
- <ui:fragment rendered="#{basket.isEmpty()}">
+ <ui:fragment rendered="#{basketController.isEmpty()}">
<ui:include src="/WEB-INF/templates/basket/mini_basket_empty.tpl" />
</ui:fragment>
- <ui:fragment rendered="#{basket.hasItems()}">
- <ui:include src="/WEB-INF/templates/basket/mini_basket.tpl" />
+ <ui:fragment rendered="#{basketController.hasItems()}">
+ <ui:include src="/WEB-INF/templates/basket/mini_basketController.tpl" />
</ui:fragment>
</ui:composition>
<tag>
<name>mini_basket</name>
<description>A mini basket showing latest added item and a link to the full basket web page</description>
- <tag-class>org.mxchange.pizzaapplication.tags.basket.MiniBasketTag</tag-class>
+ <tag-class>org.mxchange.pizzaapplication.tags.basketController.MiniBasketTag</tag-class>
<attribute>
<name>basket</name>
<description>Basket instance, should be the same as the bean</description>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
- <type>org.mxchange.jshopejb.beans.basket.BasketBean</type>
+ <type>org.mxchange.jshopejb.beans.basketController.BasketBean</type>
</attribute>
</tag>
</taglib>
</ui:define>
<ui:define name="content">
- <!--
- TODO Not used!
- <h:panelGrid class="basket_item_table" columnClasses="table_data_column" headerClass="table_header_column">
- <f:facet name="header">
- Bestellen? Bestellmenge: Produkt: Einzelpreis:
- </f:facet>
- </h:panelGrid>
- //-->
-
- <table class="basket_item_table">
- <thead>
- <tr>
- <th colspan="5" class="table_header">
- Folgendes kann bestellt werden:
- </th>
- </tr>
-
- <tr>
- <th class="table_header_column">
- Bestellen?
- </th>
-
- <th class="table_header_column">
- Anzahl:
- </th>
-
- <th class="table_header_column">
- Produkt:
- </th>
-
- <th class="table_header_column">
- Einzelpreis:
- </th>
-
- <th class="table_header_column">
- Zwischensumme:
- </th>
- </tr>
- </thead>
- </table>
-
- <ui:repeat var="product" value="#{controller.availableProducts}">
- <ui:fragment rendered="#{basket.isProductAdded(product)}">
- <table class="basket_item_table">
- <tbody>
- <tr>
- <td class="table_data_column">
- <h:link outcome="basket" title="Zum Warenkorb" value="Warenkorb" />
- </td>
-
- <td class="table_data_column">
- #{basket.currentItem.amount}
- </td>
-
- <td class="table_data_column">
- #{product.title}
- </td>
-
- <td class="table_data_column" align="right">
- <h:outputText class="price" value="#{product.price}">
- <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
- </h:outputText>
- </td>
-
- <td class="table_data_column" align="right">
- <h:outputText class="price" value="#{basket.calculateItemPrice()}">
- <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" />
- </h:outputText>
- </td>
- </tr>
- </tbody>
- </table>
- </ui:fragment>
-
- <ui:fragment rendered="#{basket.isProductAdded(product) == false}">
- <h:form acceptcharset="utf-8" id="add_item">
- <table class="basket_item_table">
- <tbody>
- <tr>
- <td class="table_data_column">
- <h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basket.addItem(product)}" title="Fuegt das Produkt dem Warenkorb hinzu" />
- </td>
-
- <td class="table_data_column">
- <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basket.amount}" required="true" requiredMessage="#{msg.ITEM_AMOUNT_IS_REQUIRED}" title="Geben Sie hier die Bestellmenge ein.">
- <!--
- If the customer wants to order more, he need to call in.
- //-->
- <f:validateLongRange for="amount" minimum="1" maximum="10" />
- </h:inputText>
- </td>
-
- <td class="table_data_column">
- #{product.title}
- </td>
-
- <td class="table_data_column" align="right">
- <h:outputText class="price" value="#{product.price}">
- <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
- </h:outputText>
- </td>
-
- <td class="table_data_column" align="right">
- -
- </td>
- </tr>
- </tbody>
- </table>
- </h:form>
- </ui:fragment>
- </ui:repeat>
+ <h:form acceptcharset="utf-8" id="add_item">
+ <div class="table">
+ <div class="table_header">
+ Folgendes kann bestellt werden:
+ </div>
+ </div>
+
+ <h:dataTable value="#{controller.availableProducts}" var="product" headerClass="table_header_column" class="table">
+ <h:column>
+ <f:facet name="header"><h:outputText value="Bestellen?" /></f:facet>
+ <h:commandButton class="submit" id="add" value="Hinzufügen" action="#{basketController.addItem(product)}" title="#{msg.BUTTON_TITLE_ADD_ITEM_TO_BASKET}" rendered="#{basketController.amount == null || basketController.amount == 0}" />
+ <h:link outcome="basket" title="Zum Warenkorb" value="Warenkorb" rendered="#{basketController.amount > 0}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header"><h:outputText value="Anzahl:" /></f:facet>
+ <h:inputText class="input" id="amount" size="3" maxlength="20" value="#{basketController.amount}" title="#{msg.INPUT_TITLE_ENTER_ITEM_AMOUNT}">
+ <!--
+ If the customer wants to order more, he need to call in.
+ //-->
+ <f:validator for="amount" validatorId="ItemAmountValidator" />
+ </h:inputText>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header"><h:outputText value="Produkt:" /></f:facet>
+ <h:outputText class="price" value="#{product.title}">
+ <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+ </h:outputText>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header"><h:outputText value="Einzelpreis:" /></f:facet>
+ <h:outputText class="price" value="#{product.price}">
+ <f:convertNumber type="currency" minFractionDigits="2" maxFractionDigits="2" locale="de_DE" />
+ </h:outputText>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header"><h:outputText value="Zwischensumme:" /></f:facet>
+ <h:outputText value="-" rendered="#{basketController.amount == null || basketController.amount == 0}" />
+ <h:outputText value="#{basketController.calculateItemPrice}" rendered="#{basketController.amount > 0}" />
+ </h:column>
+ </h:dataTable>
+ </h:form>
</ui:define>
<ui:define name="footer">