Files
itc.webengineering/src/main/webapp/klausur2/booking.xhtml
2026-02-13 00:37:32 +01:00

39 lines
1.4 KiB
HTML

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:ui="jakarta.faces.facelets"
xmlns:f="jakarta.faces.core"
xmlns:h="jakarta.faces.html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Booking Website</title>
</h:head>
<body>
<f:view>
<h:form>
<h:panelGrid columns="2">
<h:outputLabel for="name">Name: </h:outputLabel>
<h:inputText id="name" value="#{bookingBean.passengerName}"/>
<h:outputLabel for="bagsInput">Anzahl Koffer: </h:outputLabel>
<h:inputText id="bagsInput" value="${bookingBean.luggageCount}">
<p:ajax event="keyup"
process="@this"
listener="#{bookingBean.calculate}"
update="priceOutput"
/>
</h:inputText>
<h:outputLabel for="priceOutput">Aktueller Preis</h:outputLabel>
<h:outputText id="priceOutput" value="#{bookingBean.totalPrice} $"/>
<h:outputText value="" />
<h:commandButton value="Jetzt buchen" action="#{bookingBean.book}"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>