Plantillas Primefaces JSF
  • Introduction
  • Proyecto JEE
    • Introduccion
    • POSEIDON
    • Descomprimir template
    • Proyecto JEE
    • Dependencias
    • Sources
    • Ejecutar proyecto
    • TEMPLATE RESPONSIVE
    • Plantilla Bootfaces
      • Introduction
      • Plantilla
        • Clonar Template
        • Proyecto EJB
        • Proyecto Web
        • template base
        • top
        • footer.xhtml
        • Properties
        • Roles
        • Util
        • template base
        • page
  • Capitulo II. Crear EJB
    • MongoDB
    • Proyecto EJB
    • Dependencias
    • Paquetes
    • Provider
    • Entity
    • Repository
    • Converter
    • Services
    • Datamodel
  • Capitulo III. Configuracion
    • Paquetes
    • Util
    • Properties
    • Template
    • Footer
    • Logo
    • Componentes
  • Capitulo IV. Login
    • Dependencias ejb
    • Roles
    • ApplicationMenu
    • RolAdministrador
    • ValidadorRoles
    • LoginController
    • Login.xhtml
  • Capitulo V. Menu
    • Menu
  • Capitulo VI Controller
    • Controller Simple
    • Implementar IController
    • Colapsar Codigo
    • Atributos
    • GetPages
    • Init
    • Reset
    • Prepare
    • ShowAll
    • IsNew
    • Save
    • Edit
    • Delete
    • Print
    • handleSelected
    • Paginacion
    • Codigo Completo
  • Capitulo VII Formularios
    • Carpetas
    • list.xhtml
    • new
    • view
  • Capitulo X Referenciados y Embebidos
    • Referenciados
  • Plantilla Bootfaces
    • Untitled
Powered by GitBook
On this page
  • Componentes
  • accesodenegado.xhtml
  • activo.xhtml

Was this helpful?

  1. Capitulo III. Configuracion

Componentes

PreviousLogoNextDependencias ejb

Last updated 6 years ago

Was this helpful?

Componentes

Los componentes nos permiten extender los elementos Java Server Faces

  • Dentro de resources crear la carpeta avbravo

Crear dos paginas

  • accesodenegado.xhtml

  • activo.xhtml

accesodenegado.xhtml

<?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:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:b="http://bootsfaces.net/ui">
    <composite:interface >
        <composite:attribute name="renderedcondition" />
    </composite:interface>
    <composite:implementation>

        <h:form id="formaccesodenegado" rendered="#{cc.attrs.renderedcondition}">

            <b:panel look="danger" title="#{app['title.accesodenegado']}">

               <h:panelGrid columns="2" cellpadding="5">
                    <p:commandButton class="btn btn-success" action="#{loginController.irLogin}"
                                     value="#{app['button.return']}" ajax="false"/>

                </h:panelGrid>
            </b:panel>
        </h:form>
    </composite:implementation>

</html>

activo.xhtml

<?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:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:b="http://bootsfaces.net/ui">
    <composite:interface >


        <composite:attribute name="beanValue" />
        <composite:attribute name="rendered"/>

    </composite:interface>
    <composite:implementation>

        <b:selectOneMenu id="activo" value="#{cc.attrs.beanValue}"
                         required="true"
                         rendered="#{cc.attrs.rendered}"
                         requiredMessage="#{app['title.activo']} #{app['info.notnull']}">

            <f:selectItem itemLabel="#{app['button.yes']}" itemValue="si" />
            <f:selectItem itemLabel="#{app['button.no']}" itemValue="no" />
        </b:selectOneMenu>
    </composite:implementation>

</html>