You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mark Robinson <ma...@mizar.com> on 2007/02/24 05:07:26 UTC

Bug in t:JSCook with using JSPX instead of JSP files

Hi

I've found an interesting bug when using the JSCook menus.  If I create 
a .jsp file I can use JSCook,  for example, this works:

<%@ 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"%>
<html>
    <body><f:view>
            <h:form>
                <t:jscookMenu layout="hbr" theme="ThemeOffice">
                    <t:navigationMenuItem id="nav_1" itemLabel="Hello">
                        <t:navigationMenuItem id="nav_1_1"
                                              itemLabel="Sub-Menu 1"/>
                        <t:navigationMenuItem itemLabel="Part 
2"></t:navigationMenuItem>
                    </t:navigationMenuItem>
                </t:jscookMenu>
            </h:form>
        </f:view></body>
</html>

However, if I create as a JSPX file I get errors during rendering:
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns="http://www.w3.org/1999/xhtml"
          xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:t="http://myfaces.apache.org/tomahawk">
  <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="en">
    <head>
      <title></title>
    </head>
    <body>
      <f:view>
        <h:form>
            <t:jscookMenu layout="hbr" theme="ThemeOffice">
              <t:navigationMenuItem id="nav_1" itemLabel="Hello">
                <t:navigationMenuItem id="nav_1_1" itemLabel="Sub-Menu 1"/>
              </t:navigationMenuItem>
              <t:navigationMenuItem itemLabel="Part 
2"></t:navigationMenuItem>
            </t:jscookMenu>
        </h:form>
      </f:view>
    </body>
  </html>
</jsp:root>

Specifically, I get
Error: myThemeOfficeBase is not defined
Source File: 
http://192.168.0.101:8988/MizarTagLibraries-Examples-context-root/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11722898/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemeOffice/theme.js
Line: 4

Error: mismatched tag. Expected: </td>.
Source File:
Line: 1, Column: 1448
Source Code:
<html xmlns="http://www.w3.org/1999/xhtml"><body 
xmlns="http://www.w3.org/1999/xhtml"><form 
xmlns="http://www.w3.org/1999/xhtml"><div 
xmlns="http://www.w3.org/1999/xhtml"><table summary="main menu" 
class="ThemeOfficeMenu" cellspacing="0"><tr><td 
class="ThemeOfficeMainItem" onmouseover="cmItemMouseOver 
(this,'ThemeOffice',1,'cmSubMenuID1','hbr',0)" 
onmouseout="cmItemMouseOut (this,500)" onmousedown="cmItemMouseDown 
(this,0)" onmouseup="cmItemMouseUp (this,0)"><span 
class="ThemeOfficeMainFolderLeft"></span><span 
class="ThemeOfficeMainFolderText">Hello</span><span 
class="ThemeOfficeMainFolderRight"></span></td><td 
class="ThemeOfficeMainItem" onmouseover="cmItemMouseOver 
(this,'ThemeOffice',1,null,'hbr',2)" onmouseout="cmItemMouseOut 
(this,500)" onmousedown="cmItemMouseDown (this,2)" 
onmouseup="cmItemMouseUp (this,2)"><span 
class="ThemeOfficeMainItemLeft"></span><span 
class="ThemeOfficeMainItemText">Part 2</span><span 
class="ThemeOfficeMainItemRight"></span></td></tr></table><div 
class="ThemeOfficeSubMenu" id="cmSubMenuID1"><table summary="sub menu" 
cellspacing="0" class="ThemeOfficeSubMenuTable"><tr 
class="ThemeOfficeMenuItem" onmouseover="cmItemMouseOver 
(this,'ThemeOffice',0,null,'vbr',1)" onmouseout="cmItemMouseOut 
(this,500)" onmousedown="cmItemMouseDown (this,1)" 
onmouseup="cmItemMouseUp (this,1)"><td 
class="ThemeOfficeMenuItemLeft"><td 
class="ThemeOfficeMenuItemText">Sub-Menu 1<td 
class="ThemeOfficeMenuItemRight"></td></tr></table></div>


Error: uncaught exception: [Exception... "An invalid or illegal string 
was specified"  code: "12" nsresult: "0x8053000c 
(NS_ERROR_DOM_SYNTAX_ERR)"  location: 
"http://192.168.0.101:8988/MizarTagLibraries-Examples-context-root/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11722898/navmenu.jscookmenu.HtmlJSCookMenuRenderer/JSCookMenu.js 
Line: 321"]

This is in FireFox 2.0, IE 7 just displays the HTML without rendering.  
This is very peculiar, does anyone have any ideas?  I'm using 
Tomahawk-1.1.3.

Mark