@ -16,10 +16,11 @@
< center > < h2 > M A R C A S< / h2 > < / center >
< / ui:define >
< ui:define name = "left" >
< ui:define name = "left" >
< h:form >
< p:menu style = "border-color: gray; margin: 1px; width: 163px; height: 600px;" >
< h:form >
< p:menu style = "border-color: gray; margin: 1px; width: 163px; height: 600px;" >
< p:menuitem action = "ProductoLista.xhtml" value = "Productos" ajax = "false" icon = "pi pi-shopping-bag" iconPos = "left" style = "background-color: lightgray" styleClass = "botonMenu" / >
< p:menuitem action = "proveedorLista.xhtml" value = "Proveedores" ajax = "false" icon = "pi pi-id-card" iconPos = "left" style = "background-color: white " styleClass = "botonMenu" / >
@ -31,13 +32,16 @@
< / h:form >
< / ui:define >
< ui:define name = "content" >
< ui:define name = "content" >
< f:view >
< h:form id = "formtabla" >
< p:growl id = "growl" showDetail = "true" / >
< p:growl id = "growl" showDetail = "true" / >
< p:dataTable id = "tabla" value = "#{demoBeanMarca.marcas}" var = "item"
widgetVar="marcas" emptyMessage="No se han encontrado marc as"
< p:dataTable id = "tabla" value = "#{demoBeanMarca.marcas}" var = "item"
widgetVar="categorias" emptyMessage="No se han encontrado categori as"
filteredValue="#{demoBeanMarca.filteredCustomers3}"
globalFilterFunction="#{demoBeanMarca.globalFilterFunction}"
scrollable="true" scrollHeight="480" >
@ -49,92 +53,132 @@
update=":dialog" value="Nuevo" icon="pi pi-plus" />
< i class = "pi pi-search" style = "margin-left: 765px; margin-top: 10px;" > < / i >
< p:inputText id = "globalFilter" onkeyup = "PF('marcas').filter()" style = "width:300px; margin-left: 10px; margin-top: -40px; float: right;"
placeholder="Buscar marca " />
< p:inputText id = "globalFilter" onkeyup = "PF('categorias').filter()" placeholder = "Buscar categoria"
style="width:300px; margin-left: 10px; float: right; margin-top: -40px; " />
< / div >
< / div >
< / f:facet >
< / f:facet >
< p:column styleClass = "columnaId" >
< f:facet name = "header" >
< h:outputText value = "Id" style = "font-weight:bolder" / >
< h:outputText value = "Id" style = " font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.id}" / >
< h:outputText value = "#{item.id}" / >
< / p:column >
< p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Nombre" style = "font-weight:bolder" / >
< h:outputText value = "Nombre" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.nombre}" style = "margin-left: 170px" / >
< h:outputText value = "#{item.nombre}" / >
< / p:column >
< p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Proveedor" style = "font-weight:bolder" / >
< h:outputText value = "Proveedor" style = "font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.proveedorId.nombre} " style = "margin-left: 170px " / >
< h:outputText value = "#{item.proveedorId.nombre}" / >
< / p:column >
< p:column styleClass = "columnaOpc" >
< f:facet name = "header" >
< h:outputText value = "Opciones" style = "font-weight:bolder; margin-right: 90px" / >
< p:column styleClass = "columnaOpc" >
< f:facet name = "header" >
< h:outputText value = "Opciones" style = " font-weight:bolder;" / >
< / f:facet >
< p:commandButton ajax = "true" oncomplete = "PF('dlg').show();" actionListener = "#{demoBeanMarca.preparareditar(item)}" update = ":dialog" style = "margin-right: 10px; " icon = "pi pi-file-edit" / >
< p:commandButton action = "marcaEliminar.xhtml" actionListener = "#{demoBeanMarca.preparareliminar(item)}" style = "background-color: red; color:white; border-color: red; " icon = "pi pi-trash" / > < / p:column >
< p:commandButton ajax = "true" oncomplete = "PF('dlg').show();" actionListener = "#{demoBeanMarca.preparareditar(item)}"
icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px "/>
< p:commandButton ajax = "true" oncomplete = "PF('dlg2').show();" actionListener = "#{demoBeanMarca.preparareliminar(item)}"
icon="pi pi-trash" update=":dialog2" style="background-color: red; border-color: red; color:white; "/>
< / p:column >
< / p:dataTable >
< / h:form >
<!-- CREAR/EDITAR -->
< p:dialog id = "dialog" widgetVar = "dlg" width = "700" height = "250" modal = "true" appendTo = "@(body)" >
< h:form >
< p:growl id = "growl" for = "categoriaMsj" showDetail = "true" / >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; " >
< h:outputText value = "#{demoBeanMarca.titulo}" / > < / h3 >
< h3 style = "text-align: center; padding: 10px; " >
< / h3 >
< p:dialog id = "dialog" widgetVar = "dlg" width = "400" height = "300" modal = "true" >
< h:panelGrid id = "grid" columns = "3" style = "width: 100%" >
< h:form class = "form-container" >
< h1 > < h:outputText value = "#{demoBeanMarca.titulo}" / > < / h1 >
< h:panelGrid id = "grid" columns = "3" style = "width: 100%" >
< p:outputLabel value = "Nombre:" for = "nombre" / >
< p:inputText id = "nombre" value = "#{demoBeanMarca.marca.nombre}" title = "Nombre" required = "true" requiredMessage = "Falta el campo Nombre." styleClass = "formulario-elemento; " / >
< p:message for = "nombre" / >
< p:outputLabel value = "Nombre:" for = "nombre" / >
< p:inputText id = "nombre" value = "#{demoBeanMarca.marca.nombre}" title = "Nombre" required = "true" requiredMessage = "Falta el campo Nombre." styleClass = "formulario-elemento" / >
< p:message for = "nombre" / >
< p:outputLabel style = "font-weight:bolder;" value = "Proveedor:" for = "proveedorId" / >
< p:selectOneMenu id = "proveedorId" value = "#{demoBeanMarca.marca.proveedorId}" converter = "selectOneMenuConverter" >
< f:selectItems value = "#{demoBeanProveedor.all}" var = "item" itemLabel = "#{item.nombre}" itemValue = "#{item}" / >
< / p:selectOneMenu >
< / h:panelGrid >
< p:outputLabel style = "font-weight:bolder;" value = "Proveedor:" for = "proveedorId" / >
< p:selectOneMenu id = "proveedorId" value = "#{demoBeanMarca.marca.proveedorId}" converter = "selectOneMenuConverter" >
< f:selectItems value = "#{demoBeanProveedor.all}" var = "item" itemLabel = "#{item.nombre}" itemValue = "#{item}" / >
< / p:selectOneMenu >
< div style = "margin-top: 30px;" >
< p:commandButton action = "categoriaLista.xhtml" ajax = "false" icon = "pi pi-times" immediate = "true" update = "grid, formtabla:tabla, growl"
style="background-color: red; border-color:red; float: right;"/>
< / h:panelGrid >
< div >
< p:commandButton style = "margin-left: 10px; background-color:green; border-color:green; " icon = "pi pi-check" action = "#{demoBeanMarca.agregarMarca()}" update = "formtabla:tabla" ajax = "false" rendered = "#{demoBeanMarca.nuevo}" / >
< p:commandButton action = "#{demoBeanMarca.agregarMarca()}" update = "grid, formtabla:tabla, growl" ajax = "true"
rendered="#{demoBeanMarca.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right; " />
< p:commandButton action = "marcaLista.xhtml" ajax = "false" actionListener = "#{demoBeanMarca.editarmarca()}" icon = "pi pi-check" style = "margin-left: 10px; background-color:green; border-color:green;" update = "formtabla:tabla" immediate = "true" rendered = "#{!demoBeanMarca.nuevo}" / >
< p:commandButton action = "#{demoBeanMarca.editarmarca()}"
update="grid, formtabla:tabla, growl" ajax="true" rendered="#{!demoBeanMarca.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right;" />
< / div >
< / h:form >
< / p:dialog >
< p:commandButton action = "marcaLista.xhtml" ajax = "false" icon = "pi pi-times" immediate = "true" style = "background-color: red; border-color:red;" / >
<!-- ELIMINAR -->
< p:dialog id = "dialog2" widgetVar = "dlg2" width = "700" height = "250" modal = "true" >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; " >
< h:outputText value = "E L I M I N A R" / > < / h3 >
< h:form >
< div >
< h:panelGrid id = "grid" columns = "2" style = "width: 100%;" cellpadding = "10" >
< h:outputText value = "Id:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.id}" title = "Id" / >
< h:outputText value = "Nombre:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.nombre}" title = "Nombre" / >
< h:outputText value = "Proveedor" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.proveedorId.nombre}" title = "Nombre" / >
< / div >
< / h:form >
< / p:dialog >
< / f:view >
< / h:panelGrid >
< / div >
< div style = "margin-top: 5px;" >
< p:commandButton action = "marcaLista.xhtml" icon = "pi pi-times" ajax = "false" immediate = "true"
style="margin-left: 10px; background-color:red; border-color:red; float: right;" />
< p:commandButton action = "marcaLista.xhtml" actionListener = "#{demoBeanMarca.eliminarmarca()}"
ajax="false" icon="pi pi-check"
style=" background-color:green; border-color:green; float: right;"/>
< / div >
< / h:form >
< / p:dialog >
< / ui:define >
< / f:v iew >
< / ui:define >
< / ui:composition >
< / body >
< / html >