blob: 5798299718a26e1d0a0c6b02896f4c2bdd9bf907 [file]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version
2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the
License.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>OpenWebBeans :: Examples</title>
</head>
<body>
<div>
<h3>Shopping Card Example</h3>
<ul>
<li>When user clicks <b style="color:red;">"Starts Shopping"</b> button, new conversation is started. When user clicks <b style="color:red;">"Checkout"</b> button, conversation ends.</li>
<li>When user clicks <b style="color:red;">"Add Item"</b> link in the table, it adds new item to the buyer's shopping card.</li>
<li>When user clicks <b style="color:red;">"To Listing Page"</b> button, it shows content of buyer shopping card in a new page.</li>
</ul>
</div>
<h:form id="form">
<div>
<h:outputText value="Current Conversation Id : " style="color:red;"/>
<h:outputText value="#{shoppingBean.conversation.id}" id="conversation" style="font-weight:bold;" />
</div>
<div style="margin-top: 10px;">
<h:commandButton id="button1" value="Starts Shopping" action="#{shoppingBean.startShopping}">
</h:commandButton>
<h:commandButton id="button3" value="To Listing Page" action="toListingPage">
</h:commandButton>
<h:commandButton id="button4" value="Checkout" action="#{shoppingBean.checkout}">
</h:commandButton>
</div>
<div style="margin-top: 10px;">
<h3>Products Details</h3>
<h:dataTable cellpadding="1" cellspacing="5" value="#{allProducts}" var="item" binding="#{shoppingBean.uiTable}">
<h:column>
<f:facet name="header">
<h:outputText value="Product Name" />
</f:facet>
<h:outputText value="#{item.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Product Price" />
</f:facet>
<h:outputText value="#{item.price}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<h:commandLink action="#{shoppingBean.buy}" value="Add Item to Card" />
</h:column>
</h:dataTable>
</div>
<div style="margin-top: 10px;">
<h3>Current Shopping Card Content</h3>
<h:dataTable cellpadding="1" cellspacing="5" value="#{selectedItems}" var="item">
<h:column>
<f:facet name="header">
<h:outputText value="Product Name" />
</f:facet>
<h:outputText value="#{item.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Product Price" />
</f:facet>
<h:outputText value="#{item.price}" />
</h:column>
</h:dataTable>
</div>
</h:form>
</body>
</html>