list.xhtml

Creamos la carpeta notificaciones dentro de Web-Pages y creamos la pagina list.xhtml

Formulario

codigo

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<ui:composition template="/layout/template.xhtml" 
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:b="http://bootsfaces.net/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:jmoordbjsf="http://jmoordbjsf.com/taglib"
                xmlns:e="http://xmlns.jcp.org/jsf/composite/extensions">
    <ui:define name="content">


        <style>
            .thumbnail { max-width: 100%; }
            img.thumbnail:hover, img.thumbnail:focus {
                border: 1px solid;
                border-color: #428BCA;
            } 
        </style>

        <b:form id="form"  prependId="false"  rendered="#{p:ifAnyGranted('ADMINISTRADOR, DOCENTE, ADMINISTRATIVO,SECRETARIA')}" onkeypress="if (event.keyCode == 13) {
                    return false;
                }">

            <b:growl  id="msgs"/>

            <b:panel collapsible="false" title="#{app['titlelist.jmoordbNotifications']}" id="content"   look="primary" > 
                <!--<b:panelGrid colSpans="2,10" size="xs">--> 
                <b:commandButton value="#{app['button.markall']}" 
                                 action="#{jmoordbNotificationsController.markAsViewedAll()}"
                                 iconAwesome="fa-check-square-o" 
                                 update=":form:dataTable, :form:msgs"/>

            </b:panel>
            <b:panel collapsible="false" id="dataTable"  look="primary">

                <jmoordbjsf:paginator 
                    controller="#{jmoordbNotificationsController}"     
                    renderedNew="false"
                    renderedPrint="false"
                    rowPage="#{jmoordbNotificationsController.rowPage}"                   
                    page="#{jmoordbNotificationsController.page}"
                    pages="#{jmoordbNotificationsController.pages}"
                    skip="ajax:jmoordbNotificationsController.skip()" 
                    url = "/pages/jmoordbNotifications/new.xhtml"
                    />

                <p:dataTable value="#{jmoordbNotificationsController.jmoordbNotificationsDataModel}"
                             var="item"
                             id="dataTable2"
                             reflow="true"
                             >
                    <p:column style="width:16px">
                        <p:rowToggler />
                    </p:column>

                    <p:column  headerText="#{app['field.idjmoordbnotifications']}" style="width:75px">
                        <p:outputLabel value="#{item.idjmoordbnotifications}"/>
                    </p:column>

                    <p:column  headerText="#{app['field.message']}">
                        <p:outputLabel value="#{item.message}"/>
                    </p:column>  
                 

                    <p:rowExpansion>

                        <b:panelGrid id="panel" colSpans="2,10" size="sm" rendered="#{p:ifGranted('ADMINISTRATIVO')}"> 
                            <p:outputLabel value="#{app['field.type']}"/>
                            <p:outputLabel value="#{item.type}"/>
                            <p:outputLabel value="#{msg['field.nombre']}"/>
                            <p:outputLabel value="#{jmoordbNotificationsController.generateUsuario(item.username).nombre}"/>
                            <p:outputLabel value="#{app['field.email']}"/>
                            <p:outputLabel value="#{jmoordbNotificationsController.generateUsuario(item.username).email}"/>

                        </b:panelGrid>
                    </p:rowExpansion>
                    <p:column  headerText="#{app['field.date']}" style="width:80px">
                        <p:outputLabel value="#{jmoordbNotificationsController.showDate(item.date)}"/>
                    </p:column>
                    <p:column  headerText="#{app['field.viewed']}" style="width:50px">
                        <p:outputLabel value="#{item.viewed}"/>
                    </p:column>
                    <p:column headerText="" style="width:70px">
                        <b:commandButton action="#{jmoordbNotificationsController.markAsViewed(item)}"
                                         iconAwesome="fa-check-square-o" 
                                         update=":form:dataTable, :form:msgs"/>



                    </p:column>

                </p:dataTable>
            </b:panel>

        </b:form>

        <jmoordbjsf:denegado renderedcondition="#{!p:ifAnyGranted('ADMINISTRADOR, DOCENTE, ADMINISTRATIVO, SECRETARIA')}"/>

    </ui:define>
</ui:composition>

Last updated