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.
151 lines
7.9 KiB
151 lines
7.9 KiB
7 months ago
|
<?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">
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<ui:composition template="./template/principal.xhtml">
|
||
|
|
||
|
<ui:define name="top">
|
||
|
top
|
||
|
</ui:define>
|
||
|
|
||
|
<ui:define name="left">
|
||
|
left
|
||
|
</ui:define>
|
||
|
|
||
|
<ui:define name="right">
|
||
|
right
|
||
|
</ui:define>
|
||
|
|
||
|
<ui:define name="content">
|
||
|
<f:view>
|
||
|
<h:form>
|
||
|
|
||
|
<h1><h:outputText value="#{demoBeanProducto.titulo}"/></h1>
|
||
|
<h:panelGrid columns="3" cellpadding="7">
|
||
|
|
||
|
<p:outputLabel value="Nombre:" for="nombre" />
|
||
|
<p:inputText id="nombre"
|
||
|
value="#{demoBeanProducto.producto.nombre}"
|
||
|
title="Nombre"
|
||
|
required="true"
|
||
|
validatorMessage="El nombre no es valido"
|
||
|
requiredMessage="Este campo no puede estar vacio">
|
||
|
|
||
|
<f:validateRegex pattern="\b[A-Za-zÁáÉéÍíÓóÚúÜüÑñ]{3,}(?:\s+[A-Za-zÁáÉéÍíÓóÚúÜüÑñ]{3,})*\b"
|
||
|
for="nombre" />
|
||
|
|
||
|
</p:inputText>
|
||
|
<p:message for="nombre" />
|
||
|
|
||
|
<p:outputLabel value="Codigo:" for="codigo" />
|
||
|
<p:inputText id="codigo"
|
||
|
value="#{demoBeanProducto.producto.codigo}"
|
||
|
title="Codigo"
|
||
|
required="true"
|
||
|
converterMessage="Solo se aceptan digitos"
|
||
|
requiredMessage="Este campo no puede estar vacio"/>
|
||
|
<p:message for="codigo" />
|
||
|
|
||
|
<p:outputLabel value="Precio:" for="precio" />
|
||
|
<p:inputText id="precio"
|
||
|
value="#{demoBeanProducto.producto.precio}"
|
||
|
title="Precio"
|
||
|
required="true"
|
||
|
converterMessage="Solo se aceptan digitos"
|
||
|
requiredMessage="Este campo no puede estar vacio"/>
|
||
|
<p:message for="precio" />
|
||
|
|
||
|
<p:outputLabel value="Piezas:" for="piezas" />
|
||
|
<p:inputText id="piezas"
|
||
|
value="#{demoBeanProducto.producto.piezas}"
|
||
|
title="Piezas"
|
||
|
required="true"
|
||
|
converterMessage="Solo se aceptan digitos"
|
||
|
requiredMessage="Este campo no puede estar vacio"/>
|
||
|
<p:message for="piezas" />
|
||
|
|
||
|
<p:outputLabel value="Marca:"
|
||
|
for="marcaId"/>
|
||
|
|
||
|
<p:selectOneMenu id="marcaId"
|
||
|
value="#{demoBeanProducto.producto.marcaIdmarca}"
|
||
|
converter="selectOneMenuConverter"
|
||
|
required="true"
|
||
|
requiredMessage="Se necesita una marca" >
|
||
|
<!-- TODO: update below reference to list of available items-->
|
||
|
<f:selectItems value="#{demoBeanMarca.marcas}"
|
||
|
var="item"
|
||
|
itemLabel="#{item.nombre}"
|
||
|
itemValue="#{item}"/>
|
||
|
</p:selectOneMenu>
|
||
|
<p:message for="marcaId" />
|
||
|
|
||
|
<p:outputLabel value="Proveedor:"
|
||
|
for="proveedorIdproveedor" />
|
||
|
|
||
|
<p:selectOneMenu id="proveedorIdproveedor"
|
||
|
value="#{demoBeanProducto.producto.proveedorIdproveedor}"
|
||
|
converter="selectOneMenuConverter"
|
||
|
required="true"
|
||
|
requiredMessage="Se necesita un proveedor" >
|
||
|
<!-- TODO: update below reference to list of available items-->
|
||
|
<f:selectItems value="#{demoBeanProveedor.proveedores}"
|
||
|
var="item"
|
||
|
itemLabel="#{item.nombre}"
|
||
|
itemValue="#{item}"/>
|
||
|
</p:selectOneMenu>
|
||
|
<p:message for="proveedorIdproveedor" />
|
||
|
|
||
|
<p:outputLabel value="Ubicacion"
|
||
|
for="ubicacionId" />
|
||
|
|
||
|
<p:selectOneMenu id="ubicacionId"
|
||
|
value="#{demoBeanProducto.producto.ubicacionId}"
|
||
|
converter="selectOneMenuConverter"
|
||
|
required="true"
|
||
|
requiredMessage="Se necesita una ubicacion">
|
||
|
<!-- TODO: update below reference to list of available items-->
|
||
|
<f:selectItems value="#{demoBeanUbicacion.ubicacion}"
|
||
|
var="item"
|
||
|
itemLabel="#{item.bloque}#{item.anaquel}"
|
||
|
itemValue="#{item}"/>
|
||
|
</p:selectOneMenu>
|
||
|
<p:message for="ubicacionId" />
|
||
|
</h:panelGrid>
|
||
|
|
||
|
<p:commandButton action="#{demoBeanProducto.agregarProducto()}"
|
||
|
update="messages"
|
||
|
rendered="#{demoBeanProducto.nuevo}"
|
||
|
ajax="false"
|
||
|
styleClass="ui-button-success"
|
||
|
style="width: 50px;"
|
||
|
icon="pi pi-check"/>
|
||
|
|
||
|
<p:commandButton action="#{demoBeanProducto.editarProducto()}"
|
||
|
update="messages"
|
||
|
rendered="#{!demoBeanProducto.nuevo}"
|
||
|
ajax="false"
|
||
|
icon="pi pi-save"
|
||
|
styleClass="ui-button-success"
|
||
|
style="width: 50px;"/>
|
||
|
|
||
|
<p:commandButton action="productoLista.xhtml"
|
||
|
immediate="true"
|
||
|
ajax="false"
|
||
|
style="margin-left: 5px; width: 50px; "
|
||
|
icon="pi pi-times"
|
||
|
styleClass="ui-button-danger"/>
|
||
|
</h:form>
|
||
|
</f:view>
|
||
|
</ui:define>
|
||
|
</ui:composition>
|
||
|
|
||
|
</body>
|
||
|
</html>
|