@ -16,10 +16,11 @@
< center > < h2 > M A R C A S< / h2 > < / center >
< center > < h2 > M A R C A S< / h2 > < / center >
< / ui:define >
< / 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 = "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" / >
< 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 >
< / h:form >
< / ui:define >
< / ui:define >
< ui:define name = "content" >
< ui:define name = "content" >
< f:view >
< f:view >
< h:form id = "formtabla" >
< 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"
< p:dataTable id = "tabla" value = "#{demoBeanMarca.marcas}" var = "item"
widgetVar="marcas" emptyMessage="No se han encontrado marc as"
widgetVar="categorias" emptyMessage="No se han encontrado categori as"
filteredValue="#{demoBeanMarca.filteredCustomers3}"
filteredValue="#{demoBeanMarca.filteredCustomers3}"
globalFilterFunction="#{demoBeanMarca.globalFilterFunction}"
globalFilterFunction="#{demoBeanMarca.globalFilterFunction}"
scrollable="true" scrollHeight="480" >
scrollable="true" scrollHeight="480" >
@ -49,92 +53,132 @@
update=":dialog" value="Nuevo" icon="pi pi-plus" />
update=":dialog" value="Nuevo" icon="pi pi-plus" />
< i class = "pi pi-search" style = "margin-left: 765px; margin-top: 10px;" > < / i >
< 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;"
< p:inputText id = "globalFilter" onkeyup = "PF('categorias').filter()" placeholder = "Buscar categoria"
placeholder="Buscar marca " />
style="width:300px; margin-left: 10px; float: right; margin-top: -40px; " />
< / div >
< / div >
< / div >
< / div >
< / f:facet >
< / f:facet >
< p:column styleClass = "columnaId" >
< p:column styleClass = "columnaId" >
< f:facet name = "header" >
< f:facet name = "header" >
< h:outputText value = "Id" style = "font-weight:bolder" / >
< h:outputText value = "Id" style = " font-weight:bolder; " / >
< / f:facet >
< / f:facet >
< h:outputText value = "#{item.id}" / >
< h:outputText value = "#{item.id}" / >
< / p:column >
< / p:column >
< p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< f:facet name = "header" >
< h:outputText value = "Nombre" style = "font-weight:bolder" / >
< h:outputText value = "Nombre" style = "font-weight:bolder; " / >
< / f:facet >
< / f:facet >
< h:outputText value = "#{item.nombre}" style = "margin-left: 170px" / >
< h:outputText value = "#{item.nombre}" / >
< / p:column >
< / p:column >
< p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< f:facet name = "header" >
< h:outputText value = "Proveedor" style = "font-weight:bolder" / >
< h:outputText value = "Proveedor" style = "font-weight:bolder; " / >
< / f:facet >
< / f:facet >
< h:outputText value = "#{item.proveedorId.nombre} " style = "margin-left: 170px " / >
< h:outputText value = "#{item.proveedorId.nombre}" / >
< / p:column >
< / p:column >
< p:column styleClass = "columnaOpc" >
< p:column styleClass = "columnaOpc" >
< f:facet name = "header" >
< f:facet name = "header" >
< h:outputText value = "Opciones" style = " font-weight:bolder;" / >
< h:outputText value = "Opciones" style = "font-weight:bolder; margin-right: 90px" / >
< / f:facet >
< / 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 >
< / p:dataTable >
< / h:form >
< / 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 >
< 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 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 >
< 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;"/>
< 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 = "#{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 >
<!-- 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 >
< p:dialog id = "dialog" widgetVar = "dlg" width = "400" height = "300" modal = "true" >
< 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 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 >
< div >
< div >
< h:panelGrid id = "grid" columns = "2" style = "width: 100%;" cellpadding = "10" >
< 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}" / >
< h:outputText value = "Id:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.id}" title = "Id" / >
< 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}" / >
< h:outputText value = "Nombre:" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.nombre}" title = "Nombre" / >
< p:commandButton action = "marcaLista.xhtml" ajax = "false" icon = "pi pi-times" immediate = "true" style = "background-color: red; border-color:red;" / >
< h:outputText value = "Proveedor" style = " font-weight:bolder" / >
< h:outputText value = "#{demoBeanMarca.marca.proveedorId.nombre}" title = "Nombre" / >
< / 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 >
< / div >
< / h:form >
< / h:form >
< / p:dialog >
< / p:dialog >
< / f:view >
< / f:view >
< / ui:define >
< / ui:define >
< / ui:composition >
< / ui:composition >
< / body >
< / body >
< / html >
< / html >