7 Replies Latest reply on May 28, 2007 4:47 AM by Ilya Shaikovsky

    modalPanel not working

    Ypatios Asmanidis Newbie

      I want to use modalPanel so I include this to my xhtml page

      
      <a href="javascript:Richfaces.showModalPanel('mp',{width:450, top:200})">?</a>
      
       <rich:modalPanel id="mp">
       <p> he there
      
       <a href="javascript:Richfaces.hideModalPanel('mp')">hide this panel</a>:
       Richfaces.hideModalPanel('mp')</p>
      
      </rich:modalPanel>
      
      


      then when viewing the source code of the page I see this

      
      <link rel='stylesheet' type='text/css' href='/c2if_sys/a4j.res/org/richfaces/renderkit/html/css/modalPanel.xcss/DATA/eAFbJaehBAADeAET.xhtml' /><script type='text/javascript' src='/c2if_sys/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.xhtml'></script><script type='text/javascript' src='/c2if_sys/a4j.res/prototype.js.xhtml'></script><script type='text/javascript' src='/c2if_sys/a4j.res/org/richfaces/renderkit/html/scripts/utils.js.xhtml'></script><script type='text/javascript' src='/c2if_sys/a4j.res/org/richfaces/renderkit/html/scripts/modalPanel.js.xhtml'></script><script type='text/javascript' src='/c2if_sys/a4j.res/org/richfaces/renderkit/html/scripts/modalPanelBorders.js.xhtml'></script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      
      
      


      but when clicking to show the panel nothing happens...

      Some other components works fine but modalPanel doesn't....

        • 1. Re: modalPanel not working
          Alexander Belov Novice

          What browser do you use?

          • 2. Re: modalPanel not working
            Ypatios Asmanidis Newbie

            hmmm, 2.0.0.3 firefox but the live demo is working fine

            • 3. Re: modalPanel not working
              Ypatios Asmanidis Newbie

              ok I tried with IE 6 and 7 still nothing and also in IE 5 I see javacript error in taskbar...

              • 4. Re: modalPanel not working
                Alexander Belov Novice

                Hmm... It is very strange. I can advice to use the latest snapshoot. I have used modalPanel for a long time, but there were no problem.

                Is it your full source code of the page? It is very strange that your tag doesn't appear.

                • 5. Re: modalPanel not working
                  Ypatios Asmanidis Newbie

                  here are some more details

                  xhtml page

                  
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:s="http://jboss.com/products/seam/taglib"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:c="http://java.sun.com/jstl/core"
                   xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
                  
                  
                  <body>
                  
                  
                  
                  
                  <ui:composition
                   template="extras/template.xhtml">
                  <ui:define name="maincontent">
                  <c:if test="#{some.something}">
                   <span class="errorMessages">doing something
                  
                  
                   <a href="javascript:Richfaces.showModalPanel('mp',{width:450, top:200})">?</a></span>
                  
                   <rich:modalPanel id="mp">
                   <p> he there
                  
                   <a href="javascript:Richfaces.hideModalPanel('mp')">hide this panel</a>:
                   Richfaces.hideModalPanel('mp')</p>
                  
                  </rich:modalPanel>
                  </c:if>
                  </ui:define>
                  
                  </ui:composition>
                  </body>
                  
                  </html>
                  
                  


                  my WEB-INF/lib has
                  ajax4jsf-1.1.0.jar, oscache-2.3.jar,richfaces-3.0.0.jar
                  


                  my web.xml

                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                   <!-- Seam -->
                  
                   <listener>
                   <listener-class>
                   org.jboss.seam.servlet.SeamListener
                   </listener-class>
                   </listener>
                  
                  
                   <!-- Conversation Timeout -->
                   <context-param>
                   <param-name>
                   org.jboss.seam.core.manager.conversationTimeout
                   </param-name>
                   <param-value>120000</param-value>
                   </context-param>
                  
                  
                   <!-- Propagate conversations across redirects -->
                   <filter>
                   <filter-name>Seam Redirect Filter</filter-name>
                   <filter-class>
                   org.jboss.seam.servlet.SeamRedirectFilter
                   </filter-class>
                   </filter>
                  
                   <filter-mapping>
                   <filter-name>Seam Redirect Filter</filter-name>
                   <url-pattern>*.xhtml</url-pattern>
                   </filter-mapping>
                  
                   <filter>
                   <filter-name>Seam Exception Filter</filter-name>
                   <filter-class>
                   org.jboss.seam.servlet.SeamExceptionFilter
                   </filter-class>
                   </filter>
                  
                   <filter-mapping>
                   <filter-name>Seam Exception Filter</filter-name>
                   <url-pattern>/*</url-pattern>
                   </filter-mapping>
                  
                   <!-- JSF -->
                  
                   <session-config>
                   <session-timeout>15</session-timeout>
                   </session-config>
                  
                   <context-param>
                   <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                   <param-value>client</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                   <param-value>.xhtml</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>true</param-value>
                   </context-param>
                  
                   <servlet>
                   <servlet-name>Faces Servlet</servlet-name>
                   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                  
                   <!-- Faces Servlet Mapping -->
                   <servlet-mapping>
                   <servlet-name>Faces Servlet</servlet-name>
                   <url-pattern>*.xhtml</url-pattern>
                   </servlet-mapping>
                  
                   <!-- MyFaces -->
                   <listener>
                   <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
                   </listener-class>
                   </listener>
                  
                   <!-- JSF RI -->
                   <!--
                   <listener>
                   <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                   </listener>
                   -->
                  
                   <!-- Filter to set the character encoding to UTF-8 -->
                  
                  
                   <filter>
                   <filter-name>Charset Filter</filter-name>
                   <filter-class>c2iff.utilities.CharsetFilter</filter-class>
                   <init-param>
                   <param-name>requestEncoding</param-name>
                   <param-value>UTF-8</param-value>
                   </init-param>
                   </filter>
                  
                  
                   <filter-mapping>
                   <filter-name>Charset Filter</filter-name>
                   <url-pattern>/*</url-pattern>
                   </filter-mapping>
                  
                  
                  
                   <error-page>
                   <error-code>404</error-code>
                   <location>/pagenotfound.xhtml</location>
                   </error-page>
                  
                   <error-page>
                   <error-code>500</error-code>
                   <location>/pagenotfound.xhtml</location>
                   </error-page>
                  
                   <!-- Security Configuration -->
                  
                  
                  
                  
                  
                   <security-constraint>
                   <web-resource-collection>
                   <web-resource-name>Protected Pages</web-resource-name>
                   <url-pattern>/*</url-pattern>
                   </web-resource-collection>
                  
                  
                  
                   <user-data-constraint>
                   <transport-guarantee>CONFIDENTIAL</transport-guarantee>
                   </user-data-constraint>
                   </security-constraint>
                  
                  
                  
                  <!-- Rich Faces -->
                  
                  <context-param>
                  
                   <param-name>org.ajax4jsf.SKIN</param-name>
                  
                   <param-value>blueSky</param-value>
                  
                   </context-param>
                  
                   <filter>
                  
                   <display-name>Ajax4jsf Filter</display-name>
                  
                   <filter-name>ajax4jsf</filter-name>
                  
                   <filter-class>org.ajax4jsf.Filter</filter-class>
                  
                   </filter>
                  
                   <filter-mapping>
                  
                   <filter-name>ajax4jsf</filter-name>
                  
                   <servlet-name>Faces Servlet</servlet-name>
                  
                   <dispatcher>REQUEST</dispatcher>
                  
                   <dispatcher>FORWARD</dispatcher>
                  
                   <dispatcher>INCLUDE</dispatcher>
                  
                   </filter-mapping>
                  
                  
                  
                  
                  
                  
                  <!--
                   <context-param>
                   <param-name>facelets.LIBRARIES</param-name>
                   <param-value>/WEB-INF/uai.tablib.xml</param-value>
                   </context-param>
                   -->
                  
                  </web-app>
                  
                  
                  


                  more info,

                  I use seam-1.1.6 and jboss-4.0.4.GA

                  • 6. Re: modalPanel not working
                    Ivan Tufegdzic Newbie

                    I have problem with modalPanel,too.

                    It happens because <ui:define name="body_name">.
                    What do I do?

                    • 7. Re: modalPanel not working
                      Ilya Shaikovsky Master

                      I can advice you to read developer guide. "Different environments settings" chapter. And also update yuour libraries tro latest 3.0.1 SNAPSHOTS to avouid bugs which was present in old modal window version.