Fórum Não consulta JSF #468390
30/01/2014
0
obs: video aula
codigo
<!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://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head><title>Listagem de setores</title></h:head>
<h:body>
<h:form>
<h:messages />
<h:commandLink action="/index?faces-redirect=true" value="Inicio" /><br/>
<h:commandLink action="#{controleSetor.novo()}" value="Novo registro" />
<h:panelGrid columns="5">
<h:selectOneMenu value="#{controleSetor.dao.ordemAtual}"
converter="#{controleSetor.dao.converterOrdem}">
<f:selectItems value="#{controleSetor.dao.listaOrdem}"/>
<f:ajax execute="@form" render="@form"/>
</h:selectOneMenu>
<h:outputLabel value="Filtro" />
<h:inputText value="#{controleSetor.dao.filtro}" >
<f:ajax execute="@form" render="@form" event="keyup"/>
</h:inputText>
<h:outputLabel value="Maximo objetos" />
<h:inputText value="#{controleSetor.dao.maximoObjetos}" >
<f:ajax execute="@form" render="@form" event="keyup"/>
</h:inputText>
</h:panelGrid>
<h:dataTable value="#{controleSetor.dao.listar()}" var="obj"
frame="box" rules="all" cellpadding="3">
<f:facet name="heaxer">Listagem de Setores</f:facet>
<f:facet name="footer">
<div align="center">
<h:outputLabel value="#{controleSetor.dao.mensagemNavegacao}" /><br/>
<h:commandButton action="#{controleSetor.dao.primeiro()}"
value="Primeiro" >
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
<h:commandButton action="#{controleSetor.dao.anterior()}"
value="Anterior" >
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
<h:commandButton action="#{controleSetor.dao.proximo()}"
value="Proximo" >
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
<h:commandButton action="#{controleSetor.dao.ultimo()}"
value="Ultimo" >
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
</div>
</f:facet>
<h:column>
<f:facet name="header">ID</f:facet>
#{obj.id}
</h:column>
<h:column>
<f:facet name="header">Nome</f:facet>
#{obj.nome}
</h:column>
<h:column>
<f:facet name="header">Alterar</f:facet>
<h:commandLink action="#{controleSetor.alterar(obj)}" value="Alterar" />
</h:column>
<h:column>
<f:facet name="header">Excluir</f:facet>
<h:commandLink action="#{controleSetor.excluir(obj)}" value="Excluir"
onclick="if (!confirm('Confirme a exclusão do setor?')) return false" />
</h:column>
</h:dataTable>
</h:form>
</h:body>
</html>
Eduardo Pessoa
Curtir tópico
+ 0Posts
30/01/2014
Eduardo Pessoa
Gostei + 0
02/02/2014
Eduardo Pessoa
Gostei + 0
04/02/2014
Eduardo Pessoa
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)