blob: 237f09a2aefa7560c2577b8c86c0d8ef71c05cdf [file]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<title>OpenWebBeans :: Examples :: Reservation</title>
<link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/main.css"/>
</head>
<body>
<ui:composition template="/adminMenu.xhtml">
<ui:define name="caption">
<h:outputText value="Define New Hotel" styleClass="captionTitle" />
</ui:define>
<ui:define name="body">
<h:form id="form">
<h:panelGrid columns="2" styleClass="table" cellspacing="2" cellpadding="5" columnClasses="leftColumns,rightColumns">
<h:outputLabel for="name">
<h:outputText value="Name" />
</h:outputLabel>
<h:inputText value="#{adminBean.name}" id="name" required="true" requiredMessage="Name is required!"/>
<h:outputLabel for="star">
<h:outputText value="Star" />
</h:outputLabel>
<h:inputText value="#{adminBean.star}" id="star" required="true" requiredMessage="Star is required!" converterMessage="Star must between [1-5]" validatorMessage="Star must between [1-5]">
<f:convertNumber integerOnly="true"/>
<f:validateLongRange maximum="5" minimum="1"/>
</h:inputText>
<h:outputLabel for="city">
<h:outputText value="City" />
</h:outputLabel>
<h:inputText value="#{adminBean.city}" id="city" required="true" requiredMessage="City is required">
</h:inputText>
<h:outputLabel for="country">
<h:outputText value="Country" />
</h:outputLabel>
<h:inputText value="#{adminBean.country}" id="country" required="true" requiredMessage="Country name is required!">
</h:inputText>
<h:commandButton id="add" action="#{adminBean.addNewHotel}" value="Add Hotel" />
<h:commandButton action="false" value="Clear Form" immediate="true" onclick="document.forms[0].reset();document.getElementById('form:name').focus();return false;" />
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>
</body>
</html>