<?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" >
< center > < H2 > R O L E S < / H2 > < / center >
< / ui:define >
< ui:define name = "left" >
< h:form >
< p:menu style = "border-color: gray; width: 163px; height: 630px;" >
< p:menuitem action = "ProductoLista.xhtml" value = "Productos" ajax = "false" icon = "pi pi-shopping-bag" iconPos = "left" style = "background-color: lightgray; height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "proveedorLista.xhtml" value = "Proveedores" ajax = "false" icon = "pi pi-id-card" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "marcaLista.xhtml" value = "Marcas" ajax = "false" icon = "pi pi-tag" iconPos = "left" style = "background-color: lightgray ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "categoriaLista.xhtml" value = "Categorias" ajax = "false" icon = "pi pi-star" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "UbicacionAlmacenLista.xhtml" value = "Almacen" ajax = "false" icon = "pi pi-map-marker" iconPos = "left" style = "background-color: lightgray ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "usuariosLista.xhtml" value = "Usuarios" ajax = "false" icon = "pi pi-users" iconPos = "left" style = "background-color: white ;height: 90px;" styleClass = "botonMenu" / >
< p:menuitem action = "rolLista.xhtml" value = "Roles" ajax = "false" icon = "pi pi-sitemap" iconPos = "left" style = "background-color: lightgray ;height: 80px;" styleClass = "botonMenu" / >
< / p:menu >
< / h:form >
< / ui:define >
< ui:define name = "content" >
< f:view >
< h:form id = "formtabla" >
< p:growl id = "grsowl" showDetail = "true" / >
< p:dataTable id = "tabla" value = "#{demoBeanRol.all}" var = "item"
widgetVar="Rol" emptyMessage="No se han encontrado el usuario"
filteredValue="#{demoBeanRol.filteredCustomers3}"
globalFilterFunction="#{demoBeanRol.globalFilterFunction}"
scrollable="true" scrollHeight="480" >
< f:facet name = "header" >
< div class = "flex justify-content-end" style = "height: 30px;" >
< div >
< p:commandButton ajax = "true" oncomplete = "PF('dlg').show();" actionListener = "#{demoBeanRol.prepararNuevo()}"
update=":dialog" value="Nuevo" icon="pi pi-plus" />
< i class = "pi pi-search" style = "margin-left:690px; margin-top: 10px;" > < / i >
< p:inputText id = "globalFilter" onkeyup = "PF('rol').filter()" placeholder = "Buscar rol"
style="width:250px; margin-right: 120px; float: right; margin-top: -1px;" />
< p:commandButton value = "Logout" ajax = "false" icon = "pi pi-sign-out" action = "#{demoBeanLogin.logout()}" style = "background-color: #036FAB; width: 100px; float: right; margin-top: -40px " / >
< / div >
< / div >
< / f:facet >
< p:column styleClass = "columnaId2" style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Id" style = " font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.id}" / >
< / p:column >
< p:column style = "text-align: center" >
< f:facet name = "header" >
< h:outputText value = "Rol" style = " font-weight:bolder; " / >
< / f:facet >
< h:outputText value = "#{item.rol}" / >
< / p:column >
< 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 = "#{demoBeanRol.prepararEditar(item)}"
icon="pi pi-file-edit" update=":dialog" style="margin-right: 10px "/>
< p:commandButton ajax = "true" oncomplete = "PF('dlg2').show();" actionListener = "#{demoBeanRol.prepararEliminar(item)}"
update=":dialog2" style="background-color: red; color:white; border-color: red; " icon="pi pi-trash" />
< / p:column >
< / p:dataTable >
< / h:form >
<!-- crear/editar''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -->
< p:dialog id = "dialog" widgetVar = "dlg" width = "700" height = "200" modal = "true" appendTo = "@(body)" >
< h:form >
< p:growl id = "growl" for = "rolMsj" showDetail = "true" / >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; ; margin-bottom: 10px;" >
< h:outputText value = "#{demoBeanRol.titulo}" / > < / h3 >
< h:panelGrid id = "grid" columns = "3" style = "width: 100%" >
< p:outputLabel value = "Rol:" for = "rol" style = " font-weight:bolder" / >
< p:inputText id = "rol" value = "#{demoBeanRol.rol.rol}" title = "Rol" required = "true" requiredMessage = "este campo es obligatorio" styleClass = "formulario-elemento" / >
< p:message for = "rol" / >
< / h:panelGrid >
< div style = "margin-top: 30px;" >
< p:commandButton action = "rolLista.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 = "#{demoBeanRol.agregar()}" update = "grid, formtabla:tabla, growl" ajax = "true"
rendered="#{demoBeanRol.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right; " />
< p:commandButton action = "#{demoBeanRol.editar()}" update = "grid, formtabla:tabla, growl" ajax = "true"
rendered="#{!demoBeanRol.nuevo}" icon="pi pi-check"
style="margin-right: 10px; background-color:green; border-color:green; float: right;" />
< / div >
< / h:form >
< / p:dialog >
<!-- elimininar -->
< p:dialog id = "dialog2" widgetVar = "dlg2" width = "700" height = "200" modal = "true" >
< h:form >
< h3 style = "text-align: center; background-color: #036FAB; padding: 20px; color: #FFFFFF; margin-bottom: 10px;" >
< h:outputText value = "E L I M I N A R" / > < / h3 >
< div >
< h:panelGrid id = "grid" columns = "2" style = "width: 100%;" cellpadding = "20" >
< h:outputText value = "Id:" / >
< h:outputText value = "#{demoBeanRol.rol.id}" title = "Id" / >
< h:outputText value = "Rol:" / >
< h:outputText value = "#{demoBeanRol.rol.rol}" title = "Rol" / >
< / h:panelGrid >
< / div >
< div style = "margin-top: 5px;" >
< p:commandButton action = "rolLista.xhtml" icon = "pi pi-times" ajax = "false" immediate = "true"
style="margin-left: 10px; background-color:red; border-color:red; float: right;" />
< p:commandButton action = "rolLista.xhtml" actionListener = "#{demoBeanRol.eliminar()}"
ajax="false" icon="pi pi-check"
style=" background-color:green; border-color:green; float: right;"/>
< / div >
< / h:form >
< / p:dialog >
< / f:view >
< / ui:define >
< / ui:composition >
< / body >
< / html >