<p:commandButton> primeFaces

2 respostas
renansrr
Olá galerinha do GUJ estou com problema pare renderizar minha tabela, ao deletar o meu item na grid, o botao do primefaces nao renderiza a tabela, mas de fora da grid o botao renderiza a tabela alguem sabe oque é?.
<?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://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<f:view contentType="text/html">

</f:view>
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="../estilos/padrao.css"/>
</h:head>
<h:body>
	<h:form prependId="false">
		<p:panel id="panel" header="Manutenção de Funcionário">
			<table width="100%">
				<tr>
					<td>
						<p:commandButton value="Cadastrar" actionListener="#{funcionarioFrm.cadastrar}" ajax="false"/>
					</td>
					<td width="40px" align="center">
                         <p:ajaxStatus>  
			   				 <f:facet name="start">  
         						<h:graphicImage value="../imagens/loader.gif" />  
   				   			 </f:facet>  
   							 <f:facet name="complete">  
	                     	    <h:outputText value="" />  
			              	 </f:facet>  
   						 </p:ajaxStatus> 
                    </td>
				</tr>
				<tr>
					<td>
						<h:outputText value="Nome: " /> 
						<p:inputText id="nome" value="#{funcionarioFrm.nome}" /> &nbsp; 
						<p:commandButton value="Pesquisar" action="#{funcionarioFrm.pesquisar}" update="tabela,msgs" />
					</td>
				</tr>
			</table>
			<table width="100%">
				<tr>
					<td>
						<div style="height:300px; width:100%">
							<p:dataTable  id="tabela" var="item" value="#{funcionarioFrm.colecao}" paginator="true"
								rows="4" styleClass="margin:0px;"
								scrollable="true" liveScroll="true"
								style="width:960px;">
							   
							    <p:column headerText="AÇÃO" style="width:130px">
                                    <p:commandButton title="Alterar o registro" actionListener="#{funcionarioFrm.alterar}" image="ui-icon ui-icon-arrowrefresh-1-w" />
                                    <f:verbatim>&nbsp;</f:verbatim>
                                    <p:commandButton title="Deletar o registro" actionListener="#{funcionarioFrm.remover}" image="ui-icon-trash" onclick="if(!window.confirm('Confirma exclusão de registro?')){foco();return false;}" update="tabela,msgs"/>
                                    <f:verbatim>&nbsp;</f:verbatim>
                                </p:column>
                                
								<p:column sortBy="#{item.funcionario.nome}" headerText="NOME" style="width:300px" >  
            							<h:outputText value="#{item.funcionario.nome}" />
        						</p:column> 
        						
        						<p:column sortBy="#{item.funcionario.telefone}" headerText="TELEFONE" style="width:200px">  
            							<h:outputText value="#{item.funcionario.telefone}" />
        						</p:column>
        						
        						<p:column sortBy="#{item.funcionario.celular}" headerText="CELULAR" style="width:200px">  
            							<h:outputText value="#{item.funcionario.celular}" />
        						</p:column>
        						
        						<p:column sortBy="#{item.funcionario.cargo}" headerText="CARGO" style="width:100px">  
            							<h:outputText value="#{item.funcionario.cargo == '1' ? 'GERENTE' : item.funcionario.cargo == '2' ? 'CHAPEIRO' : item.funcionario.cargo == '3' ? 'ATENDENTE' : ''}" />
        						</p:column>
								
								<p:column sortBy="#{item.funcionario.usuario.login}" headerText="LOGIN" style="width:200px">  
            						<h:outputText value="#{item.funcionario.usuario.login}" />
        						</p:column>
								
							</p:dataTable>
						</div>
					</td>
				</tr>
			</table>
			<!--  AREA DE MENSAGENS -->
            <table width="100%">
               <tr>
                  <td>
                     <fieldset>
                          <h:panelGroup id="erros">
                           	<p:messages id="msgs" showDetail="true" globalOnly="true"/> 
                          </h:panelGroup>
                     </fieldset>
                  </td>
               </tr>                        
           </table>
		</p:panel>
	</h:form>
</h:body>
</html>

2 Respostas

jokacwb

Seguinte,

Ficou confusa sua pergunta, vc refere-se ao botão da linha 53?
Qual versão do PF vc ta usando?
Se possível poste o código do seu ManagedBean.

Uma sugestão, que não tem muito a ver com o erro, tente usar o confirmDialog (veja exemplo aqui http://www.primefaces.org/showcase/ui/confirmDialog.jsf)

*Obs: Esse tópico caberia melhor no Desenvolvimento Web.

renansrr

Exatamente o botão da linha 53 não renderiza meu data table, obrigado pela sugestão do confirme.

Criado 7 de junho de 2011
Ultima resposta 8 de jun. de 2011
Respostas 2
Participantes 2