Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

t:jscookMenu with Tiles  RSS feed

 
Thilina Annakkage
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to use jscookMenu with Struts Tiles definition template.
When I try to call my page I get 'element.jscook_action' is null or not an object. And then my menu does not show up.

I wonder whether anybody used jsCookMenu with tiles definition templates?? My guess is that there is some confliction amoung Javascripts, JSF, and tiles definition templates. I am able to get most of the common h:, f: and t: tags work with tiles, only the jsCookMenu is giving problems.


Any comments/suggetions will be greatly appreciated.

Here is the full description of my problem.


------------------------------------------
My index.jsp page calls welcome.jsp.

----------------------------------------------
Welcome.jsp looks like this

<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insert definition="welcome.page" flush="true" />


------------------------------------------
My tiles-defs.xml got the following definitions

<tiles-definitions>

<definition name="layout" path="/pages/layout.jsp">
<put name="title" value="Sample Page Title" />
<put name="header" value="/pages/header.jsp" />
<put name="footer" value="/pages/footer.jsp" />
<put name="menuBody" value="/pages/menu.jsp" />
<put name="body" value="" />
</definition>

<definition name="welcome.page" extends="layout">
<put name="body" value="/pages/welcome_body.jsp"/>
</definition>

<tiles-definitions>

------------------------------------------
My menu.jsp looks like following

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


<f:view>
<f:loadBundle basename="bundle.Messages" var="Message"/>
<t:jscookMenu layout="hbr" theme="ThemeOffice">
<t:navigationMenuItem id="nav_1" itemLabel="Home" action="go_display" />
</t:jscookMenu>
</f:view>
-------------------------------------------

My welcome_body.jsp page is a plain simple JSP with some html tags


In web.xml, I set the filter and filter-mapping

<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
....

</filter>


<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>

----------------------------------------------
Thanks again in advance
Thilina
 
Eman Abdel Fattah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I have a similar problem...
i'm using jscookMenu with struts tiles...The jscookMenu works perfectly without tiles but when i insert the page containing the menu in a template page created using tiles, the menu is never diplayed...

<f:subview id="menuHeader">
<tiles:insert attribute="Header" flush="false"/>
</f:subview>

<f:subview id="Body">
<tiles:insert attribute="Body" flush="false"/>
</f:subview>


i dont have enough javascript knowledge to be able to trace the problem...but when i tried to investigate and trace the html code generated at the rendering time, i found that the inclusion of the jscookMenu.js, theme.js and theme.css is put at the end of the html code(in a new html and head tag) after the java script that is supposed to display the menu [ cmdraw() ]....
please, if anyone could help or have any suggestions, this will be appreciated...

Thanks all
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!