April 2004
Intermediate to advanced
606 pages
20h 4m
English
In the first version of the extendable expense types feature, I use a button to switch between the standard and the extended list. Figure 8-3 shows what it looks like.
![]() |
The JSP page for this version of the entry form area is shown in Example 8-4.
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<h:form>
Title:
<h:inputText id="title" size="30" required="true"
value="#{reportHandler.currentReport.title}" />
<h:message for="title" />
<br>
Entry:
<br>
Date:
<h:inputText id="date" size="8" required="true"
value="#{entryHandler.currentEntry.date}">
<f:convertDateTime dateStyle="short" />
</h:inputText>
<h:message for="date" />
<br>
Type:
<h:selectOneMenu id="type" required="true"
value="#{entryHandler.currentEntry.type}">
<f:selectItems value="#{entryHandler.currentChoices}"/>
</h:selectOneMenu>
<h:commandButton value="Ext/Std" immediate="true"
action="#{entryHandler.toggleTypes}" /> <h:message for="type" /> <br> Amount: <h:inputText id="amount" size="8" required="true" value="#{entryHandler.currentEntry.amount}"> <f:convertNumber ...Read now
Unlock full access