JSF - Problema com h:commandLink e templates!

8 respostas
R

Pessoal, td bom?

Como ainda não vi nenhum tópico sobre isso, resolvi criar um.

Abaixo estão as páginas e suas relações com seus templates
<- indica a ligação com o template

template.xhtml <- historicos.xhtml (ui:composition)
template.xhtml <- crudtemplate.xhtml <- historicos_manut.xhtml (ui:composition)

Em historicos.xhtml, tenho um h:commandLink dentro de uma h:dataTable, da seguinte forma:

<h:commandLink title="Exibir" action="#{historicoController.preparaExibicao}">
     <h:outputText value="#{item.descricao}"/>

     <f:param name="idExibicao" value="#{item.id}"/>                        
</h:commandLink>

Quando chamo o link, sua action chama o método preparaExibicao():

public String preparaExibicao() {
        exibicao = true;
        String param = FacesUtil.getParameter("idExibicao");

        historico = historicoBLL.getDados(Long.parseLong(param));

        return "historicos_manut.xhtml";
}

Bom, ao renderizar a página historicos_manut.xhtml, seus templates nem os códigos javascript relacionados são carregados corretamente.
Ou seja, somente a página que deveria ser incluída é chamada, “congelando” o javascript e o resto da página.

Obs: observei o código-fonte de página e todas as referências aos arquivos relacionados estão OK!
Também tentei usar o h:outputLink, porém a chamada do managedBean não é imediata <f:event…>.

Obrigado!

8 Respostas

F

Olá Raphael,

No console não gera nenhum erro?

Posta aqui pra gente o seu historicos_manut.xhtml completo e também o código-fonte da página gerado.

Até.

R

Olá Fábio!

Então, nenhuma mensagem aperece no console do Firefox nem do Tomcat 6.0.26…

Para simplificar ainda mais a tarefa, tirei a chamada ao managedBean, portanto meu h:commandLink ficou:

<h:commandLink title="Exibir" action="historicos_manut.xhtml">
    <h:outputText value="#{item.descricao}"/>

    <f:param name="idExibicao" value="#{item.id}"/>                        
</h:commandLink>

Esta é a página historicos_manut.xhtml:

<?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">
<ui:composition template="../financeiroWeb/templates/crudtemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:ezcomp="http://java.sun.com/jsf/composite/ezcomp"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="conteudo_crud">
        <title>Históricos</title>       

        <h:outputText value="Descrição"/>
        <h:inputText value="#{historicoController.model.descricao}" disabled="#{historicoController.exibicao}"/>
        
        <br/><br/>
        <h:commandButton value="Salvar" action="#{historicoController.cria}"/>
    </ui:define>
</ui:composition>

O correto talvez seria usar um h:outputLink, tentando chamar o método Java de alguma maneira (até consegui, mas o valor do bean não é atualizado no momento da requisição). Então coloquei um onclick no h:commandLink, porém ocorria o mesmo erro da tentativa anterior (h:outputLink).

E infelizmente a página continua sendo carregada de forma incorreta.

Obrigado.

F

Oi Raphael,

posta o código fonte gerado aí.

R

Verdade, esqueci…

Esta é a página historicos_manut.xhtml, chamada pelo commandLink. O código está, obviamente, junto com todos os templates relacionados.

Um fato importante que percebi é que o endereço da página, no navegador, continua historicos.xhtml, e não historicos_manut.xhtml, apesar de esta última estar sendo exibida. Será que é impossível utilizar o commandLink?

Lá vai:

<?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"><head>
        <link href="../financeiroWeb/css/estilos.css" rel="stylesheet" type="text/css" />
        <link href="../financeiroWeb/css/estilos_templateusuario.css" rel="stylesheet" type="text/css" />
        <link href="../financeiroWeb/css/splitpane.css" rel="stylesheet" type="text/css" />

        <script src="../financeiroWeb/js/jquery.js" type="text/javascript"></script>
        <script src="../financeiroWeb/js/prototype.js" type="text/javascript"></script>
        <script src="../financeiroWeb/js/layout_manager.js" type="text/javascript"></script>

        <script src="../financeiroWeb/js/splitpane.js" type="text/javascript"></script>

        <script language="javascript" type="text/javascript">
            Event.observe(window, "load", function() {
                layoutManager = new LayoutManager();
                //setTimeout("slitPanesShow()", 1);
                SplitPane.setAll();
            });
        </script><script src="/financeiroWeb/javax.faces.resource/jsf.js.xhtml?ln=javax.faces" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/icepush.js.xhtml?rand=11947822" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/bridge.js.xhtml?rand=11947822" type="text/javascript"></script><script id="external-script-1" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAADlu0ZiSTam64EKaCQr9eTRTOTuQNzJNXRlYRLknj4cQ89tFfpxTEqxQnVWL4k55OPICgF5_SOZE06A" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/yui/yui-min.js.xhtml?ln=yui/3_1_1" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/loader/loader-min.js.xhtml?ln=yui/3_1_1" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/combined.js.xhtml?ln=org.icefaces.component.util" type="text/javascript"></script><link href="/financeiroWeb/javax.faces.resource/yui2-skin-sam-button/assets/button-core.css.xhtml?ln=yui/2in3" rel="stylesheet" type="text/css" /><link href="/financeiroWeb/javax.faces.resource/combined.css.xhtml?ln=org.icefaces.component.util" rel="stylesheet" type="text/css" /><script src="/financeiroWeb/javax.faces.resource/fileEntry.js.xhtml?ln=org.icefaces.component.fileentry" type="text/javascript"></script><link href="/financeiroWeb/javax.faces.resource/slider/assets/slider-core.css.xhtml?ln=yui/3_1_1" rel="stylesheet" type="text/css" /><link href="/financeiroWeb/javax.faces.resource/yui2-skin-sam-tabview/assets/tabview-core.css.xhtml?ln=yui/2in3" rel="stylesheet" type="text/css" /><script src="/financeiroWeb/javax.faces.resource/compat.js.xhtml" type="text/javascript"></script><script src="/financeiroWeb/javax.faces.resource/icefaces-compat.js.xhtml" type="text/javascript"></script></head><body>

<form action="/financeiroWeb/historicos.xhtml" enctype="application/x-www-form-urlencoded" id="j_idt7" method="post" name="j_idt7">
<input name="j_idt7" type="hidden" value="j_idt7" />
<input name="ice.window" type="hidden" value="efgqcafqpy" /><input name="ice.view" type="hidden" value="v742zye" /><script id="j_idt7:_t7_captureSubmit" type="text/javascript">ice.captureSubmit('j_idt7',false);ice.captureEnterKey('j_idt7');</script>
            <div class="lm_container" style="width: 100%; height: 600px;">
                <div class="lm_left" id="left1" style="float: left"><span class="menu_inicio" id="j_idt7:_t9">

                        <a href="index.xhtml">
                            <div id="div_titulo_app"><span class="titulo_app" id="j_idt7:_t11" title="Página inicial">E-Financeiro</span>
                            </div>
                        </a><span class="titulo_menu" id="j_idt7:_t13">A&#231;&#245;es</span>

                        <div class="menu_bar_inicio">
                            <a href="movimentos.xhtml"><span id="j_idt7:_t15">Movimentos</span></a><br />
                            <a href="caixadiario.xhtml"><span id="j_idt7:_t17">Caixa di&#225;rio</span></a><br />

                            <hr />

                            <a href="clientes.xhtml"><span id="j_idt7:_t19">Clientes</span></a><br />

                            <a href="bancos.xhtml"><span id="j_idt7:_t21">Bancos</span></a><br />
                            <a href="historicos.xhtml"><span id="j_idt7:_t23">Hist&#243;ricos</span></a><br />
                            <a href="operacoes.xhtml"><span id="j_idt7:_t25">Opera&#231;&#245;es</span></a><br />
                        </div><span class="titulo_menu" id="j_idt7:_t27">Relat&#243;rios</span>

                        <div class="menu_bar_inicio">

                            <a href="movimentos.xhtml"><span id="j_idt7:_t29">Contas a pagar/receber</span></a><br />
                            <a href="caixadiario.xhtml"><span id="j_idt7:_t31">Livro-caixa</span></a><br />
                        </div><span class="titulo_menu" id="j_idt7:_t33">Utilit&#225;tios</span>

                        <div class="menu_bar_inicio">
                            <a href="movimentos.xhtml"><span id="j_idt7:_t35">Atualizar acessos</span></a><br />
                        </div></span>

                </div>

                <div class="lm_center" id="center1" style="float: left;">
                    <center>
        <style type="text/css">
            #barra_ferramentas {
                width: 100%; 
                line-height: 30px;
                text-align: left; 
                padding-left: 10px; 
                background-image: url(../financeiroWeb/imagens/barraferramentas.png); 
                background-repeat: repeat-x;
            }        

            #barra_ferramentas * {
                padding-right: 5px;
            }
        </style>

        <div id="barra_ferramentas"><a href="historicos_manut.xhtml" id="j_idt7:j_idt38:_t40" name="j_idt7:j_idt38:_t40" title="Novo registro"><img src="../financeiroWeb/imagens/tabela/add.png" /></a><a href="" id="j_idt7:j_idt38:_t42" name="j_idt7:j_idt38:_t42" title="Excluir múltiplos"><img src="../financeiroWeb/imagens/tabela/delete.png" /></a><a href="" id="j_idt7:j_idt38:_t44" name="j_idt7:j_idt38:_t44" title="Atualizar registros"><img src="../financeiroWeb/imagens/tabela/edit.png" /></a><select id="j_idt7:j_idt38:_t46" name="j_idt7:j_idt38:_t46" size="1">	<option value="Todos">Todos</option>
	<option value="ID">ID</option>

</select><input id="j_idt7:j_idt38:_t49" name="j_idt7:j_idt38:_t49" style="min-width: 50px" type="text" /><input id="j_idt7:j_idt38:_t50" name="j_idt7:j_idt38:_t50" style="text-align: center; min-width: 30px;" title="Itens por página - Deixe o campo vazio para exibir todos os registros" type="text" /><input id="j_idt7:j_idt38:_t51" name="j_idt7:j_idt38:_t51" title="Voltar" type="submit" value="&#8592;" /><input id="j_idt7:j_idt38:_t52" name="j_idt7:j_idt38:_t52" title="Avançar" type="submit" value="&#8594;" />
        </div>

        <div style="margin: 10px; text-align: left">
        <title>Hist&#243;ricos</title><table class="tabela" id="j_idt7:_t56">
<thead>
<tr>
<th scope="col"><span id="j_idt7:_t56:_t58">Descri&#231;&#227;o</span></th>
<th scope="col"><span id="j_idt7:_t56:_t66">A&#231;&#245;es</span></th>

</tr>
</thead>
<tbody>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:0:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:0:_t60':'j_idt7:_t56:0:_t60','idExibicao':'1'},'');return false" title="Exibir"><span id="j_idt7:_t56:0:_t61">caca</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:0:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:0:_t68':'j_idt7:_t56:0:_t68','idEditar':'1'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:0:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:0:_t69':'j_idt7:_t56:0:_t69','idExcluir':'1'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>

                
                <br /><a href="#" id="j_idt7:_t56:1:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:1:_t60':'j_idt7:_t56:1:_t60','idExibicao':'2'},'');return false" title="Exibir"><span id="j_idt7:_t56:1:_t61">asdf</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:1:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:1:_t68':'j_idt7:_t56:1:_t68','idEditar':'2'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:1:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:1:_t69':'j_idt7:_t56:1:_t69','idExcluir':'2'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:2:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:2:_t60':'j_idt7:_t56:2:_t60','idExibicao':'3'},'');return false" title="Exibir"><span id="j_idt7:_t56:2:_t61">xfdhfdhfghf</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:2:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:2:_t68':'j_idt7:_t56:2:_t68','idEditar':'3'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:2:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:2:_t69':'j_idt7:_t56:2:_t69','idExcluir':'3'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:3:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:3:_t60':'j_idt7:_t56:3:_t60','idExibicao':'4'},'');return false" title="Exibir"><span id="j_idt7:_t56:3:_t61">23232323asdf</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:3:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:3:_t68':'j_idt7:_t56:3:_t68','idEditar':'4'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:3:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:3:_t69':'j_idt7:_t56:3:_t69','idExcluir':'4'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>

<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:4:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:4:_t60':'j_idt7:_t56:4:_t60','idExibicao':'5'},'');return false" title="Exibir"><span id="j_idt7:_t56:4:_t61">asdfasdfsdsdfsdfsafa</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:4:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:4:_t68':'j_idt7:_t56:4:_t68','idEditar':'5'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:4:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:4:_t69':'j_idt7:_t56:4:_t69','idExcluir':'5'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:5:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:5:_t60':'j_idt7:_t56:5:_t60','idExibicao':'6'},'');return false" title="Exibir"><span id="j_idt7:_t56:5:_t61">teste</span></a></td>

<td>

                <center><a href="#" id="j_idt7:_t56:5:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:5:_t68':'j_idt7:_t56:5:_t68','idEditar':'6'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:5:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:5:_t69':'j_idt7:_t56:5:_t69','idExcluir':'6'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:6:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:6:_t60':'j_idt7:_t56:6:_t60','idExibicao':'7'},'');return false" title="Exibir"><span id="j_idt7:_t56:6:_t61">certo</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:6:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:6:_t68':'j_idt7:_t56:6:_t68','idEditar':'7'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:6:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:6:_t69':'j_idt7:_t56:6:_t69','idExcluir':'7'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>

</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:7:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:7:_t60':'j_idt7:_t56:7:_t60','idExibicao':'8'},'');return false" title="Exibir"><span id="j_idt7:_t56:7:_t61">asdfasdf</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:7:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:7:_t68':'j_idt7:_t56:7:_t68','idEditar':'8'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:7:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:7:_t69':'j_idt7:_t56:7:_t69','idExcluir':'8'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:8:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:8:_t60':'j_idt7:_t56:8:_t60','idExibicao':'9'},'');return false" title="Exibir"><span id="j_idt7:_t56:8:_t61">asdfasdfasdfasdfasdfasdfas</span></a></td>

<td>

                <center><a href="#" id="j_idt7:_t56:8:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:8:_t68':'j_idt7:_t56:8:_t68','idEditar':'9'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:8:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:8:_t69':'j_idt7:_t56:8:_t69','idExcluir':'9'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:9:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:9:_t60':'j_idt7:_t56:9:_t60','idExibicao':'10'},'');return false" title="Exibir"><span id="j_idt7:_t56:9:_t61">testestestest</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:9:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:9:_t68':'j_idt7:_t56:9:_t68','idEditar':'10'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:9:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:9:_t69':'j_idt7:_t56:9:_t69','idExcluir':'10'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>

</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:10:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:10:_t60':'j_idt7:_t56:10:_t60','idExibicao':'11'},'');return false" title="Exibir"><span id="j_idt7:_t56:10:_t61">descri&#231;&#227;o</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:10:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:10:_t68':'j_idt7:_t56:10:_t68','idEditar':'11'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:10:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:10:_t69':'j_idt7:_t56:10:_t69','idExcluir':'11'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:11:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:11:_t60':'j_idt7:_t56:11:_t60','idExibicao':'12'},'');return false" title="Exibir"><span id="j_idt7:_t56:11:_t61">asdfasdfsdssssdfsdfsafa</span></a></td>

<td>

                <center><a href="#" id="j_idt7:_t56:11:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:11:_t68':'j_idt7:_t56:11:_t68','idEditar':'12'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:11:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:11:_t69':'j_idt7:_t56:11:_t69','idExcluir':'12'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:12:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:12:_t60':'j_idt7:_t56:12:_t60','idExibicao':'13'},'');return false" title="Exibir"><span id="j_idt7:_t56:12:_t61">teste</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:12:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:12:_t68':'j_idt7:_t56:12:_t68','idEditar':'13'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:12:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:12:_t69':'j_idt7:_t56:12:_t69','idExcluir':'13'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>

</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:13:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:13:_t60':'j_idt7:_t56:13:_t60','idExibicao':'14'},'');return false" title="Exibir"><span id="j_idt7:_t56:13:_t61"></span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:13:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:13:_t68':'j_idt7:_t56:13:_t68','idEditar':'14'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:13:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:13:_t69':'j_idt7:_t56:13:_t69','idExcluir':'14'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:14:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:14:_t60':'j_idt7:_t56:14:_t60','idExibicao':'15'},'');return false" title="Exibir"><span id="j_idt7:_t56:14:_t61">teste</span></a></td>

<td>

                <center><a href="#" id="j_idt7:_t56:14:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:14:_t68':'j_idt7:_t56:14:_t68','idEditar':'15'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:14:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:14:_t69':'j_idt7:_t56:14:_t69','idExcluir':'15'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:15:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:15:_t60':'j_idt7:_t56:15:_t60','idExibicao':'16'},'');return false" title="Exibir"><span id="j_idt7:_t56:15:_t61">teste</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:15:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:15:_t68':'j_idt7:_t56:15:_t68','idEditar':'16'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:15:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:15:_t69':'j_idt7:_t56:15:_t69','idExcluir':'16'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>

</tr>
<tr>
<td>
                
                <br /><a href="#" id="j_idt7:_t56:16:_t60" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:16:_t60':'j_idt7:_t56:16:_t60','idExibicao':'17'},'');return false" title="Exibir"><span id="j_idt7:_t56:16:_t61">teste</span></a></td>
<td>

                <center><a href="#" id="j_idt7:_t56:16:_t68" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:16:_t68':'j_idt7:_t56:16:_t68','idEditar':'17'},'');return false" title="Editar"><img src="imagens/tabela/edit.png" /></a><a href="#" id="j_idt7:_t56:16:_t69" onclick="mojarra.jsfcljs(document.getElementById('j_idt7'),{'j_idt7:_t56:16:_t69':'j_idt7:_t56:16:_t69','idExcluir':'17'},'');return false" title="Excluir"><img src="imagens/tabela/delete.png" /></a>
                </center></td>
</tr>
</tbody>
</table>

        </div>

                    </center>
                </div>
            </div>

            <script language="javascript" type="text/javascript">
                new SplitPane("left1", 15, "center1", 15, 85, { active: true });
            </script><div class="icePnlPop" id="j_idt7:j_idt78" name="j_idt7:j_idt78" style="display:none;"><table cellpadding="0" cellspacing="0"><tr><td class="icePnlPopHdr" id="j_idt7:j_idt78Handle">
                    <div id="popup-header" style="width: 100%; text-align: left;"><span id="j_idt7:_t80" style="margin-left: 5px;"></span><input class="bt_fechar" id="j_idt7:_t81" name="j_idt7:_t81" src="imagens/closingbutton.png" title="Fechar" type="image" />
                    </div></td><td class="icePnlPopHdr"><div style="width:1px;"></div></td></tr><tr id="j_idt7:j_idt78-tr"><td class="icePnlPopBody" colspan="2"><input id="j_idt7:_t145" name="j_idt7:_t145" type="submit" value="" /></td></tr></table><input id="j_idt7:j_idj_idt7:j_idt78status" name="j_idt7:j_idj_idt7:j_idt78status" type="hidden" value="" /><input id="j_idt7:j_idj_idt7:j_idt78dropID" name="j_idt7:j_idj_idt7:j_idt78dropID" type="hidden" value="" /><span id="j_idt7:j_idt78script"><script type="text/javascript">Ice.modal.stop('j_idt7:j_idt78');; Ice.DnD.adjustPosition('j_idt7:j_idt78');; new Ice.Scriptaculous.Draggable('j_idt7:j_idt78',{handle:'j_idt7:j_idt78Handle',dragGhost:false,dragCursor:false,ghosting:false,revert:false,mask:'1,4,5'});; Ice.autoPosition.stop('j_idt7:j_idt78');; Ice.autoCentre.start('j_idt7:j_idt78');; Ice.iFrameFix.start('j_idt7:j_idt78','/financeiroWeb/xmlhttp/blank');</script></span></div><span id="j_idt7hdnFldsDiv"><input name="icefacesCssUpdates" type="hidden" value="" /><input name="j_idt7:iceDND" type="hidden" /></span><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-311332769361169229:8327587715546782802" autocomplete="off" />
</form><span id="v742zye_icefaces_config"><script>ice.setupBridge('v742zye_icefaces_config', 'v742zye', 'efgqcafqpy', {deltaSubmit: false,disableDefaultErrorPopups: false,standardFormSerialization: false,sendDisposeWindow: false,blockUIOnSubmit: false});</script></span>

<form action="/financeiroWeb/historicos.xhtml" id="v742zye" method="post" name="v742zye">
<input name="v742zye" type="hidden" value="v742zye" />
<span id="v742zyehdnFldsDiv"><input name="icefacesCssUpdates" type="hidden" value="" /></span><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-311332769361169229:8327587715546782802" autocomplete="off" />
</form><span id="v742zye_icepush"><script type="text/javascript">ice.push.configuration.contextPath="/financeiroWeb";ice.push.configuration.uriPattern="/financeiroWeb/javax.faces.resource/{{command}}.xhtml";</script></span><span id="v742zye_icefaces_compat_config"><script type="text/javascript">ice.DefaultIndicators({connectionLostRedirectURI: null,sessionExpiredRedirectURI: null,connection: { context: '/financeiroWeb/'},messages: {sessionExpired: 'User Session Expired',connectionLost: 'Network Connection Interrupted',serverError: 'Server Internal Error',description: 'To reconnect click the Reload button on the browser or click the button below',buttonText: 'Reload'}},'v742zye_icefaces_compat_config');</script></span><span id="dynamic-code-compat"><script type="text/javascript"></script></span></body>
</html>
F

Opa,

ainda não identifiquei nenhum problema. =(

Se possível, posta todo o conteúdo do historicos.xhtml e também do crudtemplate.xhtml.

Até.

R

Sem problemas, mas valeu a intenção!

Bom, corrigindo a relação dos templates:

  • usertemplate.xhtml <- crudtemplate.xhtml <- historicos.xhtml (ui:composition)
  • historicos.xhtml chama historicos_manut.xhtml

OK, vou postar os códigos das páginas solicitadas.

usertemplate.xhtml (base geral)

<?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:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <link rel="stylesheet" type="text/css" href="../financeiroWeb/css/estilos.css"/>
        <link rel="stylesheet" type="text/css" href="../financeiroWeb/css/estilos_templateusuario.css"/>
        <link rel="stylesheet" type="text/css" href="../financeiroWeb/css/splitpane.css"/>

        <script type="text/javascript" src="../financeiroWeb/js/jquery.js"/>
        <script type="text/javascript" src="../financeiroWeb/js/prototype.js"></script>
        <script type="text/javascript" src="../financeiroWeb/js/layout_manager.js"></script>
        <script type="text/javascript" src="../financeiroWeb/js/splitpane.js"></script>

        <script type="text/javascript" language="javascript">
            Event.observe(window, "load", function() {
                layoutManager = new LayoutManager();
                SplitPane.setAll();
            });
        </script>
    </h:head>
    <h:body>
        <h:form>
            <div class="lm_container" style="width: 100%; height: 600px;">
                <div id="left1" class="lm_left" style="float: left">
                    <h:panelGroup styleClass="menu_inicio">

                        <a href="index.xhtml">
                            <div id="div_titulo_app">
                                <h:outputText value="E-Financeiro" styleClass="titulo_app" title="Página inicial"/>
                            </div>
                        </a>

                        <h:outputText value="Ações" styleClass="titulo_menu"/>

                        <div class="menu_bar_inicio">
                            <a href="movimentos.xhtml"><h:outputText value="Movimentos"/></a><br/>
                            <a href="caixadiario.xhtml"><h:outputText value="Caixa diário"/></a><br/>

                            <hr/>

                            <a href="clientes.xhtml"><h:outputText value="Clientes"/></a><br/>
                            <a href="bancos.xhtml"><h:outputText value="Bancos"/></a><br/>
                            <a href="historicos.xhtml"><h:outputText value="Históricos"/></a><br/>
                            <a href="operacoes.xhtml"><h:outputText value="Operações"/></a><br/>
                        </div>

                        <h:outputText value="Relatórios" styleClass="titulo_menu"/>

                        <div class="menu_bar_inicio">
                            <a href="movimentos.xhtml"><h:outputText value="Contas a pagar/receber"/></a><br/>
                            <a href="caixadiario.xhtml"><h:outputText value="Livro-caixa"/></a><br/>
                        </div>

                        <h:outputText value="Utilitátios" styleClass="titulo_menu"/>

                        <div class="menu_bar_inicio">
                            <a href="movimentos.xhtml"><h:outputText value="Atualizar acessos"/></a><br/>
                        </div>
                    </h:panelGroup>
                </div>

                <div id="center1" class="lm_center" style="float: left;">
                    <center>
                        <!-- Aqui vai o conteúdo da página -->
                        <ui:insert name="conteudo">
                            <h:outputText value="Não foi possível carregar o conteúdo da página"/>
                        </ui:insert>
                    </center>
                </div>
            </div>

            <script language="javascript" type="text/javascript">
                new SplitPane("left1", 15, "center1", 15, 85, { active: true });
            </script>
        </h:form>
    </h:body>
</html>

crudtemplate.xhtml

<?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">
<ui:composition template="../../financeiroWeb/templates/usertemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:ezcomp="http://java.sun.com/jsf/composite/ezcomp">

    <ui:define name="conteudo">
        <ezcomp:barraferramentas/>

        <div style="margin: 10px; text-align: left">
            <!-- Aqui vai o conteúdo do CRUD -->
            <ui:insert name="conteudo_crud">
                <h:outputText value="Não foi possível carregar o conteúdo da página"/>
            </ui:insert>
        </div>
    </ui:define>
</ui:composition>

historicos.xhtml

<?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">
<ui:composition template="../financeiroWeb/templates/crudtemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:ezcomp="http://java.sun.com/jsf/composite/ezcomp"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="conteudo_crud">
        <title>Históricos</title>       

        <f:metadata>
            <!-- Atribuições iniciais -->
            <f:event type="preRenderView" listener="#{barraFerramentasController.inicia}"/>
            <f:event type="preRenderView" listener="#{historicoController.atribuiInfoIniciais}"/>
        </f:metadata>

        <h:dataTable styleClass="tabela" var="item" value="#{historicoController.todos}">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Descrição"/>
                </f:facet>
                
                <br/>
                <h:commandLink title="Exibir" action="historicos_manut.xhtml">
                    <h:outputText value="#{item.descricao}"/>

                    <f:param name="idExibicao" value="#{item.id}"/>                        
                </h:commandLink>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Ações"/>
                </f:facet>

                <center>
                    <h:commandLink title="Editar" action="historicos_manut.xhtml">
                        <h:graphicImage value="imagens/tabela/edit.png"/>

                        <f:param name="idEditar" value="#{item.id}"/>
                    </h:commandLink>

                    <h:commandLink title="Excluir" action="#{historicoController.preparaExclusao}">
                        <h:graphicImage value="imagens/tabela/delete.png"/>

                        <f:param name="idExcluir" value="#{item.id}"/>
                    </h:commandLink>
                </center>
            </h:column>                
        </h:dataTable>
    </ui:define>
</ui:composition>
F

É…

Não consegui identificar nada de errado. :evil:

Quando descobrir, avisa!

Abraço e boa sorte.

R

Tranquilo.

Então, em último caso vou colocar um painel dinâmico embaixo da tabela dos históricos para exibir o conteúdo da página historicos_manut.xhtml.

Porém não sei se isso vai me ajudar por muito tempo.

Pode deixar que quando eu conseguir eu aviso aqui.

Obrigado pela ajuda!

Abraços

Criado 20 de julho de 2011
Ultima resposta 21 de jul. de 2011
Respostas 8
Participantes 2