4 Replies Latest reply on Feb 8, 2008 7:19 AM by codebreeder

    ContextMenu produces Javascript error

    codebreeder

      I can't get contextmenu working properly. It is displayed after rightclick but the menuitems have no hovering effect and the menu doesn't close. This is the same with 3.1.3GA and 3.1.4GA.

      The firebug console shows this javascript error:

      syntax error
      http://localhost:8080/bielefeld/faces/a4j_3_1_4.GAorg.ajax4jsf.javascript.PrototypeScript
      Line 25
      


      According to firebug, the syntax error is in this "code" (added a blank to preserve the &...lt;):
      & lt;!--\n
      


      This is my whole testpage:

      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      <%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
      <%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>test</title>
      </head>
      <body>
      <f:view>
       <h:outputText value="rightclickme">
       <rich:contextMenu event="oncontextmenu" attached="true" submitMode="none">
       <rich:menuItem value="Menuitem 1" onclick="alert(1);"></rich:menuItem>
       <rich:menuItem value="Menuitem 2" onclick="alert(2);"></rich:menuItem>
       </rich:contextMenu>
       </h:outputText>
      </f:view>
      </body>
      </html>