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.

164 lines
4.6 KiB

7 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">
7 months ago
7 months ago
<body>
7 months ago
<f:view>
<header style="display: flex; justify-content: center; font-size: 30px;"><strong>Tipos</strong></header>
<p:divider/>
<main style="display: flex; justify-content: space-between;">
<h:form id="tipT">
<p:growl id="messages" showDetail="true" for="tipoM"/>
<p:dataTable id="table" value="#{demoBeanTipo.tipos}" var="item" style="width: 600px"
paginator="true" rows="5" rowSelectMode="add" paginatorPosition="bottom">
<p:column>
<f:facet name="header">
<h:outputText value="Tipo"/>
</f:facet>
<h:outputText value="#{item.tipo}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Estatus"/>
</f:facet>
<h:outputText value="#{item.estado == 2 ? 'Activo':'Inactivo'}"/>
</p:column>
<p:column>
7 months ago
<f:facet name="header">
<h:outputText value="Opciones"/>
</f:facet>
7 months ago
<p:commandButton action="#{demoBeanTipo.eliminarTipo(item)}"
icon="pi pi-trash"
style="margin-left: 5px"
styleClass="ui-button-warning"
oncomplete="PF('tipo').show()"
update="table"
ajax="true"/>
7 months ago
</p:column>
7 months ago
</p:dataTable>
7 months ago
</h:form>
7 months ago
7 months ago
<h:form style="margin-left: 20px; margin-top: 20px;">
<header style="display: flex; justify-content: center;">Nuevo tipo</header>
<p:divider/>
7 months ago
7 months ago
<h:panelGrid columns="3" cellpadding="7">
<p:outputLabel value="Tipo" for="tipo" />
<p:inputText id="tipo"
value="#{demoBeanTipo.tipo.tipo}"
title="Tipo"
required="true"
requiredMessage="este campo no puede estar vacio"
validatorMessage="entrada no valida"
>
<f:validateRegex pattern="^\b[A-ZÁÉÍÓÚÜÑ][a-záéíóúüñ]{1,}\b$"
for="apellidoPaterno" />
</p:inputText>
<p:message id="tipos" for="tipo"/>
</h:panelGrid>
<footer style="display: flex; margin-top: 340px; justify-content: flex-end;"> <!-- alinear a derecha -->
<p:commandButton action="#{demoBeanTipo.agregar()}"
update="tipT:table,tipo,tipos,tipT:messages"
rendered="#{demoBeanTipo.nuevo}"
styleClass="ui-button-success"
style="width: 50px;"
icon="pi pi-save" ajax="true"
/>
<p:commandButton oncomplete="pf('tipo').close()"
immediate="true"
style="margin-left: 5px; width: 50px; "
icon="pi pi-times"
styleClass="ui-button-danger"
ajax="false"/>
</footer>
</h:form>
7 months ago
</main>
</f:view>
7 months ago
</body>
</html>