jscookMenu fora de f:view

3 respostas
R

Ola

Estou tentando usar o menu jscookMenu do tomahawk e estou tendo o seguinte problema
O menu so funciona dentro da tag <f:view> </f:view>

O problema disso é porque o menu esta localizado em um include da seguinte maneira

<!-- Header of page -->
<%@ include file="/include/page_header.jsp"%>
<f:view>
<h:form id="frmHome">

<table width="100%" height="300" cellpadding="0" cellspacing="0" border="0" class="label">
	<tr>
		<td>
			Bem vindo
		</td>
	</tr>		
</table>

</h:form>
</f:view>
<%@ include file="/include/page_footer.jsp"%>

Portanto o jscookMenu encontra-se nesse arquivo page_header.jsp com o seguinte conteudo

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="/WEB-INF/support.tld" prefix="s" %>
<f:loadBundle basename="bundle.pt.messages_default" var="msg_def"/>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Frotaway</title>
</head>
<body>

<table width="100%" cellpadding="0" cellspacing="0" style="border: 2px solid #dccebd;">
	<td bgcolor="#efebde">
		<t:jscookMenu id="menu" layout="hbr" theme="ThemeOffice" >
			<t:navigationMenuItems id="navitems" value="#{dynMenu.navItems}" />
		</t:jscookMenu>
	</td>
	
</table>

Eu tentei adicionar a tag <f:view> </f:view> no page header, mas nao deu certo porque senao da erro na pagina home.

Alguem tem alguma ideia ? tentei usar <f:view> na header e <f:subview> na home mas tb nao obtive sucesso.

Desde ja muito obrigado

3 Respostas

ganimedes

he,he nao sei se vc precisa ainda da resposta, sou novo com jsf e tive esse mesmo problema a pouco tempo, o seguinte o meu arquivo header esta desta forma:

  1. usando subview

<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h”%>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f”%>
<%@ taglib uri=“http://myfaces.apache.org/tomahawk” prefix=“t”%>
<f:subview id=“header”>
<h:form id=“frm_header”>

<t:jscookMenu layout="hbr" theme="ThemeOffice">
		<t:navigationMenuItems value="#{meuBackBean.menuItems}" />
	</t:jscookMenu>
	 
</h:form>

</f:subview>

  1. quem inclui ele tem a view, por exemplo:

<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://myfaces.apache.org/tomahawk” prefix=“t”%>

<f:view>
<jsp:include page=“common/header.jsp”/>
CONTEUDO JSF A DA PAGINA
<jsp:include page=“common/footer.jsp”/>
</f:view>

OBS: neste meu exemplo alem do header tambem tenho um footer que é incluido em todas as paginas.

felipeguerra

O pessoal abandona os posts, coloquem aí se resolveram o problema ou não…a rapaziada beginner do JSF agradece!

ganimedes

O problema foi resolvido conforme abaixo, usando subview para o conteudo a ser incluso no header. :slight_smile:

  1. usando subview

<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h”%>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f”%>
<%@ taglib uri=“http://myfaces.apache.org/tomahawk” prefix=“t”%>
<f:subview id=“header”>
<h:form id=“frm_header”>

<t:jscookMenu layout=“hbr” theme=“ThemeOffice”>
<t:navigationMenuItems value="#{meuBackBean.menuItems}" />
</t:jscookMenu>

</h:form>
</f:subview>

  1. quem inclui ele tem a view, por exemplo:

<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://myfaces.apache.org/tomahawk” prefix=“t”%>

<f:view>
<jsp:include page=“common/header.jsp”/>
CONTEUDO JSF A DA PAGINA
<jsp:include page=“common/footer.jsp”/>
</f:view>

Criado 5 de fevereiro de 2007
Ultima resposta 12 de dez. de 2007
Respostas 3
Participantes 3