Boa tarde a todos.
Já pesquisei e não conseguie encontra uma maneira viavel pra utilizar o primaface com showcase de forma
que se encontra no link abaixo!
Antes estava usando o ComdLink e funciona blz.
Mas agora to tentanto implementa dessa forma e não funciona!
Estou usando o showcase como referência que se encontra nesse link logo abaixo pra monta um dataTable bacana.
http://www.primefaces.org/showcase-labs/ui/datatableRowSelectionByColumn.jsf
Só que o seguinte é quando clico em qual quer botão do dataTable ele não faz nada.
O que realmente pode está de errado?
Alguém pode ajudar?
CODIGO DA PÁGINA
<?xml version="1.0" encoding="UTF-8"?><ui:composition template="…/layouts/layoutPrincipal.xhtml"
xmlns=“http://www.w3.org/1999/xhtml”
xmlns:ui=“http://java.sun.com/jsf/facelets”
xmlns:f=“http://java.sun.com/jsf/core”
xmlns:h=“http://java.sun.com/jsf/html”
xmlns:p=“http://primefaces.prime.com.tr/ui”>
<ui:define name=“cabecalho”>
<ui:define name=“conteudo”>
<h:head></h:head>
<h:form style=“padding-top: 20px ; padding-left: 5px”>
<p:fieldset legend=“Lista dos Grupos”>
<p:dataTable value="#{GrupoMB.listaGrupo}" var=“grupo” rows=“10” paginator=“true” >
<p:column headerText=“Nome”>
<h:outputText value="#{grupo.nome}"/>
</p:column>
<p:column headerText=“Descrição”>
<h:outputText value="#{grupo.descricao}"/>
</p:column>
<p:column headerText=“Matricula”>
<h:outputText value="#{grupo.matinclusao}"/>
</p:column>
<p:column headerText=“Data”>
<h:outputText value="#{grupo.dtinclusao}"/>
</p:column>
<p:column style=“width:100px”>
<h:panelGrid columns=“3” styleClass=“actions” cellpadding=“2”>
<p:commandButton update=":form:display" oncomplete=“carDialog.show()” image=“ui-icon ui-icon-pencil” title=“Edit”>
<f:setPropertyActionListener value="#{grupo}" target="#{GrupoMB.grupo}" />
<f:setPropertyActionListener value="#{true}" target="#{GrupoMB.atualizar}" />
</p:commandButton>
<p:commandButton update=":form:display" oncomplete=“confirmation.show()” image=“ui-icon ui-icon-close” title=“Delete”>
<f:setPropertyActionListener value="#{grupo}" target="#{GrupoMB.grupo}" />
</p:commandButton>
</h:panelGrid>
</p:column>
</p:dataTable>
<p:dialog header=“Car Detail” widgetVar=“carDialog” resizable=“false” id=“carDlg”
width=“300” showEffect=“fade” hideEffect=“explode” modal=“true”>
<h:panelGrid id=“display” columns=“2” cellpadding=“4” style=“margin:0 auto;”>
<h:outputText value=“Nome:” />
<h:panelGroup>
<h:outputText value="#{grupo.nome}" style=“font-weight:bold” rendered="#{!GrupoMB.atualizar}"/>
<p:inputText value="#{grupo.nome}" rendered="#{GrupoMB.atualizar}" required=“true” label=“Nome”/>
</h:panelGroup>
<h:outputText value=“Descrição:” />
<h:panelGroup>
<h:outputText value="#{grupo.descricao}" style=“font-weight:bold” rendered="#{!GrupoMB.atualizar}"/>
<p:inputText value="#{grupo.descricao}" rendered="#{GrupoMB.atualizar}" required=“true” label=“Descricao”/>
</h:panelGroup>
<h:outputText value=“Matricula:” />
<h:panelGroup>
<h:outputText value="#{grupo.matinclusao}" style=“font-weight:bold” rendered="#{!GrupoMB.atualizar}"/>
<p:inputText value="#{grupo.matinclusao}" rendered="#{GrupoMB.atualizar}" required=“true” label=“Matinclusao”/>
</h:panelGroup>
<h:outputText value=“Data:” />
<h:panelGroup>
<h:outputText value="#{grupo.dtinclusao}" style=“font-weight:bold” rendered="#{!GrupoMB.atualizar}"/>
<p:inputText value="#{grupo.matinclusao}" rendered="#{GrupoMB.atualizar}" required=“true” label=“Dtinclusao”/>
</h:panelGroup>
<f:facet name=“footer”>
<p:outputPanel rendered="#{GrupoMB.atualizar}" layout=“block” style=“text-align:right”>
<p:commandButton value=“Save” update=“cars msgs” actionListener="#{GrupoMB.create}"
oncomplete=“onEditComplete(xhr,status,args)” image=“ui-icon ui-icon-check”/>
<p:commandButton value=“Cancel” onclick=“carDialog.hide()” type=“button” image=“ui-icon ui-icon-close”/>
</p:outputPanel>
</f:facet>
</h:panelGrid>
</p:dialog>
</p:fieldset>
</h:form>
</ui:define>
<ui:define name=“rodape”>
<ui:include src="/rodape.xhtml"/>
</ui:define>
</ui:composition>
Meu ManegeBean
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package br.com.bb.sae.mbeans;
import br.com.bb.sae.beans.Grupo;
import br.com.bb.sae.daos.GrupoDAO;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
/**
*
-
@author t1037989
*/
@ManagedBean(name=“GrupoMB”)
@SessionScoped
public class GrupoMB implements Serializable{
private Grupo grupo = null;
private List listaGrupo = null;
public GrupoMB() {
this.grupo = new Grupo();
}
public Grupo getGrupo() {
return grupo;
}
public void setGrupo(Grupo grupo) {
this.grupo = grupo;
}
public List getListaGrupo() {
return listaGrupo;
}
public void setListaGrupo(List listaGrupo) {
this.listaGrupo = listaGrupo;
}
public String GrupoMB(){
this.grupo = new Grupo();
return null;
}
public String cancelarFormulario(){
this.grupo = new Grupo();
return “index”;
}
public String cancelarAtualizacao(){
this.grupo = new Grupo();
return “listar_todosGrupo.xhtml”;
}
public String limpa(){
this.grupo = new Grupo();
return null;
}
public String create() throws GrupoDAOExeception {
GrupoDAO idao = new GrupoDAO();
try {
idao.inserir(grupo);
} catch (Exception e) {
e.printStackTrace();
}
return “form_grupo”;
}
public String listarTodos() throws GrupoDAOExeception {
GrupoDAO idao = new GrupoDAO();
try {
setListaGrupo(idao.listarTodos());
} catch (Exception e) {
e.printStackTrace();
}
return “sucesso_todosGrupo”;
}
public String atualizar() throws GrupoDAOExeception {
GrupoDAO idao = new GrupoDAO();
try {
idao.atualizar(grupo);
grupo = new Grupo();
} catch (Exception e) {
e.printStackTrace();
}
return “sucesso_atualizarGrupo”;
}
public String excluir() throws GrupoDAOExeception {
GrupoDAO idao = new GrupoDAO();
try {
idao.excluir(grupo.getCodigo());
} catch (Exception e) {
e.printStackTrace();
}
return “sucesso_excluirGrupo”;
}
public String consultar() throws GrupoDAOExeception {
GrupoDAO idao = new GrupoDAO();
try {
Grupo grupoTmp = null;
grupoTmp = idao.consultar(grupo.getCodigo());
if (grupoTmp != null) {
this.grupo = grupoTmp;
return “sucesso_consultarGrupo”;
} else {
return “falha_consultarGrupo”;
}
} catch (Exception e) {
e.printStackTrace();
}
return ("");
}
}