/
pavelsamodurov
/
financejavaee216
Обзор
Документация
Войти
/
pavelsamodurov
/
financejavaee216
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
financejavaee-web/src/main/webapp/customers.xhtml
48 строк
2 KB
Pavel Samodurov
add customer page with table and with form for adding new customer
26 фев 2020, 21:27
26 фев 2020, 21:27
b7c415d
Код
Авторство
О чём код?
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head> <title>Customers</title> </h:head> <h:body> <p:dataTable var="customer" value="#{customerController.findAll()}"> <p:column headerText="Id"> <h:outputText value="#{customer.id}" /> </p:column> <p:column headerText="Name"> <h:outputText value="#{customer.name}" /> </p:column> <p:column headerText="Address"> <h:outputText value="#{customer.address}" /> </p:column> </p:dataTable> <h:form> <p:panel id="panel" header="New Customer"> <p:messages id="msgs" /> <h:panelGrid columns="3" cellpadding="5"> <p:outputLabel for="name" value="Name:" /> <p:inputText id="name" value="#{customerView.name}" required="true" label="Name"> <f:validateLength minimum="2" /> </p:inputText> <p:message for="name" display="icon" /> <p:outputLabel for="address" value="Address:" /> <p:inputText id="address" value="#{customerView.address}" label="Address" required="true"> <f:validateLength minimum="2" /> <p:ajax update="msgAddress" event="keyup" /> </p:inputText> <p:message for="address" id="msgAddress" display="icon" /> </h:panelGrid> <p:commandButton value="Save" update="panel" action="#{customerView.save()}" icon="pi pi-check" /> </p:panel> </h:form> </h:body> </html>