2023-09-27 13:31:02 -05:00

36 lines
1.5 KiB
HTML

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<title>Using Collections</title>
</h:head>
<h:body>
<h1 class="title">Using collections</h1>
<div align="center">
<h:form>
<h:panelGrid>
<h3>Cheap Items from Array</h3>
<h:inputText value="#{purchases.cheapItems[0]}"/>
<h:inputText value="#{purchases.cheapItems[1]}"/>
<h:inputText value="#{purchases.cheapItems[2]}"/>
<h3>Inexpensive Items from List</h3>
<h:inputText value="#{purchases.mediumItems[0]}"/>
<h:inputText value="#{purchases.mediumItems[1]}"/>
<h:inputText value="#{purchases.mediumItems[2]}"/>
<h3>Valuable Items from Map</h3>
Low:
<h:inputText value='#{purchases.valuableItems["low"]}'/>
Medium:
<h:inputText value='#{purchases.valuableItems["medium"]}'/>
High:
<h:inputText value='#{purchases.valuableItems["high"]}'/>
<h:commandButton value="Purchase" action="#{purchases.purchaseItems}"/>
</h:panelGrid>
</h:form>
</div>
</h:body>
</html>