You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
4.5 KiB

6 months ago
<?xml version="1.0" encoding="UTF-8"?>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/JSP_Servlet/XHtml.xhtml to edit this template
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<body>
<f:view>
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Paises</strong></header>
<p:divider/>
<main style="display: flex; justify-content: space-between; gap: 10px;">
<h:form id="formPais">
<p:growl id="growl" showDetail="true" for="mensajePaises"/>
<p:dataTable id="tablePais"
value="#{demoBeanPaises.paises}"
var="item"
style="width: 600px"
paginator="true"
rows="4"
rowSelectMode="add"
paginatorPosition="bottom" >
<p:column style="text-align: center;">
<f:facet name="header">
<h:outputText value="Nombre"/>
</f:facet>
<h:outputText value="#{item.nombre}"/>
6 months ago
</p:column>
<p:column style="text-align: center;">
<f:facet name="header">
<h:outputText value="Estado"/>
</f:facet>
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/>
</p:column>
<p:column style="text-align: center;">
<f:facet name="header">
<center>
<h:outputText value="Opciones"/>
</center>
</f:facet>
<p:commandButton action="#{demoBeanPaises.eliminarPais(item)}"
ajax="true"
icon="pi pi-trash"
styleClass="ui-button-warning"
style="margin-top: 5px; width: 50px;"
update="formPais" />
</p:column>
</p:dataTable>
</h:form>
<h:form style="margin-left: 20px; margin-top: 20px;">
<header style="display: flex; justify-content: center;">Nuevo Pais</header>
<p:divider/>
<h:panelGrid columns="2">
<p:outputLabel value="Nombre:" for="nombre" />
<p:inputText id="nombre"
value="#{demoBeanPaises.pais.nombre}"
title="Nombre"
required="true"
requiredMessage="The Nombre field is required."/>
<p:outputLabel></p:outputLabel>
<p:message id="alertNombre" for="nombre"/>
</h:panelGrid>
<footer style="display: flex; margin-top: 280px; justify-content: flex-end;">
<p:commandButton action="#{demoBeanPaises.agregarPais()}"
ajax="true"
styleClass="ui-button-success"
style="width: 50px;"
6 months ago
icon="pi pi-save"
6 months ago
update="formPais:tablePais, nombre, alertNombre, formPais:growl" />
<p:commandButton oncomplete="PF('pais').close()"
immediate="true"
ajax="false"
style="margin-left: 5px; width: 50px; "
icon="pi pi-times"
styleClass="ui-button-danger"/>
</footer>
</h:form>
</main>
</f:view>
</body>
</html>