Hi all,

My page inside the tiles does not submit the page.  I am using
myfaces-core-1.1.4 and tomcat 1.5.  It seems nothing works after I start to
use tiles.

This is my layout:


<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>

<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>

<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html;CHARSET=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="css/basic.css" />

</head>

<body>

<f:view>

<div id="subnavigation">

<f:subview id="menu">

<tiles:insert attribute="menu" flush="false" />

</f:subview>

</div>

<div id="level0">

<div id="level1">

<div id="topBar">

<f:subview id="header">

<tiles:insert attribute="header" flush="false"/>

</f:subview>

</div>

<div id="level2">

<f:subview id="content">

<tiles:insert attribute="body" flush="false"/>

</f:subview>

</div>

</div>

</div>

</f:view>

</body>

</html>

Here is the tiles-def.xml:

<tiles-definitions>

<definition name="admin.layout" path="/jsp/template/adminLayout.jsp">

<put name="header" value="/jsp/common/adminHeader.jsp" />

<put name="menu" value="/jsp/common/adminMenu_new.jsp" />

</definition>

<definition name="/welcome.tiles" extends="admin.layout" >

<put name="title" value="Admin - Welcome" />

<put name="body" value="/jsp/admin/welcome.jsp" />

</definition>

</tiles-definitions>

Here is the adminMenu_new.jsp:

<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>

<%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%>

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>

<f:view>

<f:loadBundle basename="com.bundle.messages" var="example_messages" />

<h:form>

<t:panelNavigation2 id="nav1" layout="list" itemClass="mypage"
activeItemClass="selected" openItemClass="selected" >

<t:commandNavigation2 value="#{example_messages['user_admin']}" >

<t:commandNavigation2 action="adduser" actionListener="#{
navigationMenu.actionListener}">

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="Add User" />

</t:commandNavigation2>

<t:commandNavigation2 action="edituser" actionListener="#{
navigationMenu.actionListener}" >

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="Edit User" />

         </t:commandNavigation2>

<t:commandNavigation2 action="viewuser" actionListener="#{
navigationMenu.actionListener}" >

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="View User" />

</t:commandNavigation2>

 </t:commandNavigation2>

<t:commandNavigation2 value="#{example_messages['role_admin']}" >

<t:commandNavigation2 action="addrole" actionListener="#{
navigationMenu.actionListener}">

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="Add Role" />

</t:commandNavigation2>

<t:commandNavigation2 action="editrole" actionListener="#{
navigationMenu.actionListener}" >

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="Edit Role" />

</t:commandNavigation2>

<t:commandNavigation2 action="viewrole" actionListener="#{
navigationMenu.actionListener}" >

<f:verbatim>&#8250; </f:verbatim>

<t:outputText value="View Role" />

</t:commandNavigation2>

</t:commandNavigation2>

</t:panelNavigation2>

</h:form>

</f:view>

Here is the addRole.jsp.  This page is the body of tiles.  When I click the
add role menu link, this addRole.jsp will be displayed in the body part of
the tiles:

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>

<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>

<h:form id="addRoleForm">

<table align="center" >

<tr>

<td>

<h1>Add Role</h1>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td colspan="2" align="center">

<h:messages errorClass="errorMessage" globalOnly="true"/>

</td>

</tr>

<tr>

<td>

<h2>General Profile</h2>

</td>

</tr>

<tr>

<td style="padding:20">

<table>

<tr>

<td >

<h:outputText value="RoleId"/>

</td>

<td >

<h:inputText value="#{roleBean.roleId}" id="roleId" />

<h:message styleClass="errorMessage" for="roleId"/>

</td>

</tr>

<tr>

<td >

<h:outputText value="Description"/>

</td>

<td >

<h:inputText value="#{roleBean.description}" id="description" />

<h:message styleClass="errorMessage" for="description"/>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td>

<h2>Access Control</h2>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td>

<h:dataTable id="categories"

value="#{roleBean.categories}"

var="category"

styleClass=""

headerClass=""

columnClasses="oddCols,evenCols"

rows="20"

width="800"

rendered="#{!empty roleBean.categories}">

<h:column>

<f:facet name="header">

<h:outputText value="Access Rights"/>

</f:facet>

<h:outputText value="#{category.accessControlPK.category}"/>

</h:column>

<h:column>

<f:facet name="header">

<h:outputText value="Permission"/>

</f:facet>

<h:selectBooleanCheckbox value="#{roleBean.controls}" />

</h:column>

</h:dataTable>

</td>

</tr>

<tr>

<td align="center">

<h:commandButton value="Add" id="add" action="success" />

<h:commandButton value = "Cancel" action="cancel" immediate="true" />

</td>

</tr>

</table>

</h:form>

When I click the add button on the addRole.jsp, the page remains the same
and did not submit and call the action method.  I don't know why and tried
many times without success. I also searched the Internet but unfortunately
there is no much help.  Can anybody please kindly help me out?  Thanks a
lot!

James

Reply via email to