Incluido selector de tema de primefaces en pagina de bienvenida (home).

* El tema seleccionado se conserva durante la sesión.
* Ya se muestran los iconos de primefaces para el tema seleccionado.
This commit is contained in:
mgarcianun
2019-11-28 19:19:57 +01:00
parent 8fcc5d7697
commit c460c6125c
10 changed files with 69 additions and 40 deletions

View File

@@ -10,12 +10,15 @@
<ui:composition template="./header.xhtml">
<ui:define name="content">
<h:form>
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
<p:panel header="Pagina principal">
<p:panelGrid>
<p:outputLabel for="basic" value="Cambio de tema" />
<p:themeSwitcher id="basic" style="width:165px">
<p:outputLabel for="selectorTema" value="Cambio de tema" />
<p:themeSwitcher id="selectorTema" style="width:165px" value="#{sessionPreferences.currentTheme}">
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
</p:themeSwitcher>
</p:panelGrid>
<h:panelGrid columns="2">
@@ -31,6 +34,13 @@
</h:panelGrid>
</h:panelGroup>
</p:panel>
<p:panel>
<h:panelGroup>
<h:panelGrid columns="1">
<p:commandButton value="Usar tema en este sesión" update="mesgs" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
</h:panelGrid>
</h:panelGroup>
</p:panel>
</h:form>
</ui:define>
</ui:composition>