📄 cartajax.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%-- jsf:pagecode language="java" location="/src/pagecode/Cartajax.java" --%><%-- /jsf:pagecode --%>
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
<html>
<head>
<title>cart</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Software Architect">
<link rel="stylesheet" type="text/css" href="theme/stylesheet.css"
title="Style">
</head>
<f:view>
<body>
<hx:scriptCollector id="scriptCollector1">
<h:form id="form1" styleClass="form">
<h:panelGrid id="grid1" columns="2" styleClass="panelGrid">
<hx:dataTableEx id="tableEx1" value="#{cart.products}"
var="varproducts" styleClass="dataTableEx"
headerClass="headerClass" border="0" cellpadding="2"
cellspacing="0" width="100%">
<hx:columnEx id="columnEx1" width="300">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Product name"
id="text1"></h:outputText>
</f:facet>
<h:outputLink id="link1">
<h:outputText id="textName1" value="#{varproducts.product.name}"
styleClass="outputText">
</h:outputText>
<hx:behavior event="onclick" behaviorAction="get;stop"
targetAction="product"></hx:behavior>
<hx:behavior event="onmouseover" behaviorAction="get;show"
targetAction="form1:descriptionPopup;form1:descriptionPopup"></hx:behavior>
<hx:behavior event="onmouseout" behaviorAction="hide"
targetAction="form1:descriptionPopup"></hx:behavior>
</h:outputLink>
<h:inputHidden id="itemid" value="#{varproducts.product.id}" />
</hx:columnEx>
<hx:columnEx id="columnEx2" align="right">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Price" id="text2"></h:outputText>
</f:facet>
<h:outputText id="textPrice1" value="#{varproducts.product.price}"
styleClass="outputText">
<hx:convertNumber type="currency" />
</h:outputText>
</hx:columnEx>
<hx:columnEx id="columnEx3" width="100" align="right">
<f:facet name="header">
<h:outputText styleClass="outputText" value="Quantity" id="text3"></h:outputText>
</f:facet>
<h:inputText id="textQuantity1" value="#{varproducts.quantity}"
styleClass="inputText" size="3">
<hx:behavior event="onblur" behaviorAction="get"
targetAction="totals"></hx:behavior>
</h:inputText>
</hx:columnEx>
</hx:dataTableEx>
<h:panelGrid id="grid2" styleClass="panelGrid">
<hx:commandExButton type="button" value="Proceed to checkout"
id="button2" styleClass="commandExButton" onclick="window.alert('This button does not do anything in this sample.');"></hx:commandExButton>
<hx:commandExButton type="button" value="Continue shopping"
id="button3" styleClass="commandExButton" onclick="window.alert('This button does not do anything in this sample.');"></hx:commandExButton>
</h:panelGrid>
<h:panelGrid id="grid5" styleClass="panelGrid" columns="1"
style="text-align:right;width:100%">
<h:panelGrid id="totals" styleClass="panelGrid" columns="2"
style="text-align:right;">
<h:outputText id="text4" styleClass="outputText"
value="Sub-total:"></h:outputText>
<h:outputText id="textTotalPrice" value="#{cart.totalPrice}"
styleClass="outputText">
<hx:convertNumber type="currency" />
</h:outputText>
<h:outputText id="text5" styleClass="outputText" value="Tax:"></h:outputText>
<h:outputText id="textTax1" value="#{cart.tax}"
styleClass="outputText">
<hx:convertNumber type="currency" />
</h:outputText>
<h:outputText id="text6" styleClass="outputText" value="Shipping:"></h:outputText>
<h:outputText id="textShipping1" value="#{cart.shipping}"
styleClass="outputText">
<hx:convertNumber type="currency" />
</h:outputText>
<h:outputText id="text7" styleClass="outputText" value="Total:"
style="font-weight: bold"></h:outputText>
<h:outputText id="textTotal1" value="#{cart.total}"
styleClass="outputText" style="font-weight: bold">
<hx:convertNumber type="currency" />
</h:outputText>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<hx:panelDialog type="modeless" id="descriptionPopup" styleClass="panelDialog"
style="background-color: #fff9ca" movable="false"
align="relative" valign="relative" saveState="false"
showTitleBar="false">
<h:outputText id="textDescription1d"
value="#{cart.selectedProduct.description}"
styleClass="outputText">
</h:outputText>
</hx:panelDialog>
<hx:ajaxRefreshRequest id="showPopup" target="descriptionPopup"
params="$$AJAXROW$$form1:tableEx1:itemid"></hx:ajaxRefreshRequest>
</h:form>
<hx:ajaxRefreshSubmit id="refreshTotals" target="totals"></hx:ajaxRefreshSubmit>
<h:panelGrid id="product" width="700" style="margin-top: 20px;"
styleClass="panelGrid">
<h:outputText id="text8" styleClass="outputText"
value="Click on a product to see its details here."
style="color: gray; font-size: 10pt"></h:outputText>
</h:panelGrid>
<hx:ajaxExternalRequest id="showDetails" target="product"
href="product.faces" source="product"
params="$$AJAXROW$$form1:tableEx1:itemid"></hx:ajaxExternalRequest>
</hx:scriptCollector>
</body>
</f:view>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -