JSF标签元刷新不起作用,什么也没发生

时间:2016-08-09 01:03:03

标签: jsf

我正在尝试使用元标记刷新刷新我的页面但没有发生任何事情...... 我使用谷歌浏览器。

<!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://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:sec="http://www.springframework.org/security/facelets/tags">

    <h:head>
    <meta http-equiv="refresh" content="5" />
    </h:head>
<!--
Visão Geral: Aqui é controlado os aparelhos de forma individual ou conjunta.
Funções:
->Ligar/Desligar aparelho individualmente, exceto os analogicos.
->Ligar/Desligar todos com exceção dos analogicos.
-->
<ui:composition template="Template.xhtml">

    <ui:define name="content" >

        <div class="content_wrapper" >

                <h:form id="formtest1">
                 <p:growl id="meuGrowl1" />  
                    <p:poll interval="20" listener="#{PortaBean.statusPortaTeste()}" update="meuGrowl1" />
                </h:form>

            <h:form id="formGrid"> 
             <p:growl id="growl" />
                <p:poll interval="10" listener="#{PortaBean.statusPortaTeste()}" update="Grid" />
                <!--   INICIO TABELA  -->

                <p:dataTable id="Grid" var="gerenciador"
                    widgetVar="tabelaGerenciador" value="#{PortaBean.listaPorta}"
                    selection="#{PortaBean.porta}" selectionMode="single"
                    rowKey="#{gerenciador.idPorta}"
                    emptyMessage="Nenhuma Porta Alocada" tableStyleClass="titulo"  paginator="true" rows="30" draggableColumns="true" >


                    <sec:ifAnyGranted
                            roles="ROLE_ADMINISTRADOR,ROLE_CLIENTE">
                            <f:facet name="header">

                        <p:commandButton id="btnLigartest"  actionListener="#{PortaBean.pulsoTest()}" value="Pulso Test" ajax="false"   /> 

                    </f:facet>        <f:facet name="header">

                        <p:commandButton id="btnLigartest1"  actionListener="#{PortaBean.pulsoTest1()}" value="Pulso TestD" ajax="false"   /> 

                    </f:facet>
                    <f:facet name="header">

                        <p:commandButton id="lista" onclick="#{MBTipo.novoTipo()};PF('listar').show();" value="Listar por Setor"    /> 

                    </f:facet>    
                    <f:facet name="header">

                        <p:commandButton id="novo" onclick="#{MBTipo.novoTipo()};PF('novo').show();" value="Ligar Todos por Setor"    /> 

                    </f:facet>        
                    <f:facet name="header">

                        <p:commandButton id="btnLigar"  actionListener="#{PortaBean.ligarTodos}" value="Ligar Todos" ajax="false"   /> 

                    </f:facet>
                    <f:facet name="header">

                        <p:commandButton id="btnDesligarTodos" actionListener="#{PortaBean.DesligarTodos}" value="Desligar Todos" ajax="false"    /> 

                    </f:facet>
                    <f:facet name="header">

                        <p:commandButton id="btnDesligarTodosPorSetor" onclick="#{MBTipo.novoTipo()};PF('novo1').show();" value="Desligar Todos por Setor"     /> 

                    </f:facet>
                    </sec:ifAnyGranted>
                        <p:column  style="text-align:center;font-weight:bold"
                        filterBy="#{gerenciador.aparelho.setor.nomeSetor}"
                        headerText="Setor" >
                        <f:facet name="header">
                            <h:outputText  value="SETOR  "/>
                            <br/>
                        </f:facet>
                        <h:outputText value="#{gerenciador.aparelho.setor.nomeSetor}"  />
                    </p:column>
                    <p:column style="text-align:center;font-weight:bold"
                        filterBy="#{gerenciador.aparelho.setor.obsSetor}"
                        headerText="Localização">
                        <f:facet name="header">
                            <h:outputText  value="LOCALIZAÇÃO  "/>
                            <br/>
                        </f:facet>
                        <h:outputText value="#{gerenciador.aparelho.setor.obsSetor}" />
                    </p:column>

                    <p:column style="text-align:center;font-weight:bold"
                        filterBy="#{gerenciador.aparelho.nomeAparelho}"
                        headerText="Aparelho">
                        <f:facet name="header">
                            <h:outputText  value="APARELHO  "/>
                            <br/>
                        </f:facet>
                        <h:outputText value="#{gerenciador.aparelho.nomeAparelho}" />
                    </p:column>
                    <p:column     
                        headerText="STATUS">
                        <div align="center">
                        <h:graphicImage   rendered="#{gerenciador.statusPorta==true}" value="/restrito/images/bola_verde.png"></h:graphicImage>
                        <h:graphicImage  rendered="#{gerenciador.statusPorta==false}" value="/restrito/images/bola_vermelha.png"></h:graphicImage>
                    </div>
                    </p:column>
                    <p:column  style="text-align:center;font-weight:bold" filterBy="#{gerenciador.placa.nomePlaca}" >
                       <f:facet name="header" >
                            <h:outputText  value="PLACA"/>
                            <br/>
                        </f:facet>
                    <h:outputText value="#{gerenciador.placa.nomePlaca}" />
                    </p:column>


                    <p:column style="text-align:center">
                     <f:facet name="header">
                     <h:outputText value="TEMPERATURA" />
                     </f:facet>
                     <h:outputText style="font-weight:bold" value="#{gerenciador.valorPorta >=10?  gerenciador.valorPorta :''} " /><h:outputText style="font-weight:bold" value="#{gerenciador.valorPorta >=10?  'ºC' :''}" />
                    </p:column>

                    <sec:ifAnyGranted
                            roles="ROLE_ADMINISTRADOR,ROLE_CLIENTE">
                    <p:column styleClass="alinharBotoesAoCentro"                    
                        headerText="Ligar/Desligar">

                        <f:facet name="header">
                            <h:outputText  value="LIGAR/DESLIGAR  "/>
                            <br/>

                        </f:facet>
                        <p:commandButton  value="Ligar/Desligar" ajax="false" update="Grid growl" actionListener="#{PortaBean.ligarDesligarRele(gerenciador)}"  />

                    </p:column>
                    </sec:ifAnyGranted>

                </p:dataTable>

            </h:form>
            <h:form id="formNovo">
                    <p:growl id="growl" />
                    <p:dialog id="dialogNovo" header="Ligar Setor"
                        widgetVar="novo" resizable="false">
                        <h:panelGrid id="painelNovo" columns="2" cellpadding="2">
                            <h:outputText value="Escolha o Setor" />
                            <p:selectOneMenu value="#{PortaBean.nomeSetor}">
                              <f:selectItem itemLabel="Selecione o Setor" itemValue="0" />
                                <f:selectItems value="#{PortaBean.listaSetor}" var="setor"
                                    itemValue="#{PortaBean.nomeSetor}" />
                            </p:selectOneMenu>


                            <p:commandButton id="cadastrar" ajax="false" value="Ligar"
                                actionListener="#{PortaBean.ligarPorSetor()}"
                                update=":formGrid growl" />
                        </h:panelGrid>
                    </p:dialog>
                </h:form>

                <h:form id="formListar">
                    <p:growl id="growl" />
                    <p:dialog id="dialogListar" header="Listar Setor"
                        widgetVar="listar" resizable="false">
                        <h:panelGrid id="painelNovo" columns="2" cellpadding="2">
                            <h:outputText value="Escolha o Setor" />
                            <p:selectOneMenu value="#{PortaBean.nomeSetor1}">
                              <f:selectItem itemLabel="Selecione o Setor" itemValue="0" />
                                <f:selectItems value="#{PortaBean.listaSetor}" var="nomeSetor1"
                                    itemValue="#{PortaBean.nomeSetor1}" />
                            </p:selectOneMenu>


                            <p:commandButton id="cadastrar" ajax="false" value="Listar"
                                actionListener="#{PortaBean.listarPorSetorx()}"
                                update=":formGrid " />
                        </h:panelGrid>
                    </p:dialog>
                </h:form>

            <h:form id="formNovo1">
                    <p:growl id="growl" />
                    <p:dialog id="dialogNovo1" header="Desligar Setor"
                        widgetVar="novo1" resizable="false">
                        <h:panelGrid id="painelNovo" columns="2" cellpadding="2">
                            <h:outputText value="Escolha o Setor" />
                            <p:selectOneMenu value="#{PortaBean.nomeSetor}">
                              <f:selectItem itemLabel="Selecione o Setor" itemValue="0" />
                                <f:selectItems value="#{PortaBean.listaSetor}" var="setor"
                                    itemValue="#{PortaBean.nomeSetor}" />
                            </p:selectOneMenu>


                            <p:commandButton id="cadastrar" ajax="false" value="Desligar"
                                actionListener="#{PortaBean.desligarPorSetor()}"
                                update=":formGrid growl" />
                        </h:panelGrid>
                    </p:dialog>
                </h:form>

        </div>

    </ui:define>

</ui:composition>
</html>

0 个答案:

没有答案