2 Replies Latest reply on Feb 2, 2010 3:53 AM by Olli H.

    #{..} is not allowed in template text

    Olli H. Newbie

      Hi,

       

      I read this great post on Ilyas blog. (http://relation.to/Bloggers/RichFacesCalendarAndScrollableExtendedTables). That is  exactly what I need, but i get this error message

      "#{..} is not allowed in template text"

       

       

      What do i have to do or to configure to solve this  error message.?

      I am using RF 3.3.1 GA and Tomcat 6.

       

      I get this message after adding this line of code into my jsp page.

      <rich:calendar id="calendar" onchanged="#{rich:component('calendar')}.customInput.value=event.rich.component.getSelectedDateString();" zindex="1000"/>

      org.apache.jasper.JasperException: /parser.jsp(50,3) #{..} is not allowed in template text
              org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
              org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
              org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:102)
              org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:713)
              org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:958)

       

      Best Regards

      Kalomo

        • 1. Re: #{..} is not allowed in template text
          Olli H. Newbie
          does  anybody know a solution to the problem?
          • 2. Re: #{..} is not allowed in template text
            Olli H. Newbie

            ok, maybe some code can help. This is my jsp testpage for the workaround.

             

            This part produces the error:  (/test.jsp(25,3) #{...} is not allowed in template text)

             

             

            <script>
                 #{rich:component('calendar')}.customExpand=customExpand;
            </script>

             

            Parsing the onchange attribute wich also includes the rich:component call seems to work.

            Does anyone have an idea why the script part couldn't be parsed?

             

            Thanx

             

             

             

            <%@ page pageEncoding="UTF-8" %>

             

            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
            <html>
                <head>
                    <title>test</title>
                </head>
                <body>
                    <f:view>

             

            <style>
                .rich-calendar-input,.rich-calendar-button {
                    display: none;
                }
            </style>
            <a4j:loadScript src="/scripts/calendarUtils.js"></a4j:loadScript>
            <rich:calendar id="calendar"
                onchanged="#{rich:component('calendar')}.customInput.value=
                 event.rich.component.getSelectedDateString();" />
            <script>
                #{rich:component('calendar')}.customExpand=customExpand;
            </script>

             

                    </f:view>
                </body>
            </html>