Advertisement
hsianghui

IS3106 Lab4 Exercise 2.3 (createCustomer.xhtml)

Sep 15th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.99 KB | None | 0 0
  1. <?xml version='1.0' encoding='UTF-8' ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml"
  4.      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  5.      xmlns:h="http://xmlns.jcp.org/jsf/html"
  6.      xmlns:f="http://xmlns.jcp.org/jsf/core"
  7.      xmlns:p="http://primefaces.org/ui">
  8.  
  9.     <body>
  10.  
  11.         <ui:composition template="./layout/default.xhtml">
  12.  
  13.             <ui:define name="title">
  14.                 New Customer
  15.             </ui:define>
  16.  
  17.             <ui:define name="content">
  18.                 <h:form>
  19.                     <p:panelGrid columns="2">
  20.                         <f:facet name="header">
  21.                             Create New Customer
  22.                         </f:facet>
  23.                         <h:outputLabel for="name">Name: </h:outputLabel>
  24.                         <p:inputText id="name" value="#{customerManagedBean.name}" />
  25.                         <h:outputLabel>Gender:</h:outputLabel>
  26.                         <p:selectOneMenu value="#{customerManagedBean.gender}">
  27.                             <f:selectItem itemValue="1" itemLabel="Female" />
  28.                             <f:selectItem itemValue="2" itemLabel="Male" />
  29.                         </p:selectOneMenu>
  30.                         <h:outputLabel for="dob">Date of Birth (dd/mm/yyyy):
  31.                         </h:outputLabel>
  32.                         <p:inputText id="dob" value="#{customerManagedBean.dob}">
  33.                             <f:convertDateTime pattern="dd/MM/yyy"/>
  34.                         </p:inputText>
  35.                     </p:panelGrid>
  36.                     <br />
  37.                     <p:commandButton value="Submit"
  38.                                     actionListener="#{customerManagedBean.addCustomer}"
  39.                                     action="searchCustomers.xhtml?faces-redirect=true"/>
  40.                 </h:form>
  41.             </ui:define>
  42.  
  43.         </ui:composition>
  44.  
  45.     </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement