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.
123 lines
6.9 KiB
123 lines
6.9 KiB
<?xml version='1.0' encoding='UTF-8' ?>
|
|
<!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="http://xmlns.jcp.org/jsf/facelets"
|
|
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
|
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
|
xmlns:p="http://primefaces.org/ui">
|
|
|
|
<h:head>
|
|
<title>Crear Proveedor</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
</h:head>
|
|
|
|
<h:body>
|
|
<center>
|
|
<ui:composition template="./template/Principal.xhtml">
|
|
|
|
<ui:define name="top">
|
|
SISTEMA DE INVENTARIO
|
|
</ui:define>
|
|
|
|
<ui:define name="left">
|
|
<!-- Contenido opcional para la parte izquierda -->
|
|
</ui:define>
|
|
|
|
<ui:define name="right">
|
|
<!-- Contenido opcional para la parte derecha -->
|
|
</ui:define>
|
|
|
|
<ui:define name="content">
|
|
<f:view>
|
|
<h:form id="proveedorForm">
|
|
|
|
<!-- Título dinámico basado en el bean -->
|
|
<h1><h:outputText value="#{demoBeanProvedor.titulo}" /></h1>
|
|
|
|
<!-- PanelGrid para organizar los campos del proveedor -->
|
|
<h:panelGrid columns="4" id="proveedorGrid">
|
|
|
|
<!-- Campo Nombre -->
|
|
<p:outputLabel value="Nombre:" for="nombre" />
|
|
<p:inputText id="nombre"
|
|
value="#{demoBeanProvedor.provedor.nombre}"
|
|
required="true"
|
|
requiredMessage="El campo nombre es obligatorio"
|
|
validatorMessage="El campo nombre no debe incluir números y debe tener entre 3 y 15 letras">
|
|
<f:validateRegex pattern="[a-zA-Z ]+" />
|
|
<f:validateLength minimum="3" maximum="15" />
|
|
</p:inputText>
|
|
<p:message for="nombre" />
|
|
|
|
<!-- Campo Dirección -->
|
|
<p:outputLabel value="Dirección:" for="direccion" />
|
|
<p:inputText id="direccion"
|
|
value="#{demoBeanProvedor.provedor.direccion}"
|
|
required="true"
|
|
requiredMessage="El campo dirección es obligatorio"
|
|
validatorMessage="La dirección no es válida">
|
|
<f:validateLength minimum="8" maximum="30" />
|
|
<f:validateRegex pattern="[a-zA-Z0-9,.# ]*" />
|
|
</p:inputText>
|
|
<p:message for="direccion" />
|
|
|
|
<!-- Campo Correo -->
|
|
<p:outputLabel value="Correo:" for="correo" />
|
|
<p:inputText id="correo"
|
|
value="#{demoBeanProvedor.provedor.correo}"
|
|
required="true"
|
|
requiredMessage="El campo correo es obligatorio"
|
|
validatorMessage="El correo no es válido">
|
|
<f:validateRegex pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}" />
|
|
<f:validateLength maximum="30" />
|
|
</p:inputText>
|
|
<p:message for="correo" />
|
|
|
|
<!-- Campo Teléfono -->
|
|
<p:outputLabel value="Teléfono:" for="telefono" />
|
|
<p:inputText id="telefono"
|
|
value="#{demoBeanProvedor.provedor.telefono}"
|
|
required="true"
|
|
requiredMessage="El campo teléfono es obligatorio"
|
|
validatorMessage="El campo teléfono no es válido">
|
|
<f:validateLength minimum="10" />
|
|
<f:validateRegex pattern="\d{10}" />
|
|
</p:inputText>
|
|
<p:message for="telefono" />
|
|
|
|
</h:panelGrid>
|
|
|
|
<!-- Botones -->
|
|
<p:commandButton action="#{demoBeanProvedor.agregarProveedor()}"
|
|
value="Agregar"
|
|
update="@form"
|
|
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;"
|
|
ajax="true" />
|
|
|
|
<p:commandButton action="Provedor.xhtml" icon="pi pi-fw pi-pencil"
|
|
actionListener="#{demoBeanProvedor.editarProvedor()}"
|
|
value="Editar"
|
|
update="@form"
|
|
rendered="#{!demoBeanProvedor.nuevo}"
|
|
style="padding: 2px 8px; font-size: 13px; font-weight: bold; color: #3366FF; background-color: #fff; border: 2px solid #3366FF; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease ; margin-right: 6px;"
|
|
|
|
ajax="true" />
|
|
|
|
<p:commandButton value="Cancelar"
|
|
immediate="true"
|
|
action="Provedor.xhtml" icon="pi pi-fw pi-times"
|
|
style=" padding: 2px 8px; font-size: 13px; font-weight: bold; color: #990000; background-color: #fff; border: 2px solid #FF0000; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease; margin-right: 6px;"
|
|
ajax="false" />
|
|
|
|
</h:form>
|
|
</f:view>
|
|
</ui:define>
|
|
|
|
<ui:define name="bottom">
|
|
|
|
</ui:define>
|
|
|
|
</ui:composition>
|
|
</center>
|
|
</h:body>
|
|
</html>
|
|
|