2 Replies Latest reply on Nov 22, 2007 2:33 PM by Jubril Adisa

    Problem using modalPanel

    Jubril Adisa Novice

      Hello all,
      I am trying to use modalPanel in my application but it keeps resulting in javascript errors please find below a sample of my code

      <body>
      <f:view>
      <h:form>
      <rich:modalPanel id="mp" minHeight="200" minWidth="450" height="200"
       width="500">
      <f:facet name="header">
      <h:outputText value="Modal Panel Title" />
      </f:facet>
      <h:outputText value="This is working"></h:outputText>
      </rich:modalPanel>
      </h:form>
      </f:view>
      <a href="javascript:Richfaces.ShowModalPanel('mp',{width:450,top:200})">Hello Hi </a>
      </body>


        • 1. Re: Problem using modalPanel
          Dmitry Demyankov Novice

          At first, modalPanel should not be inside a form.

          • 2. Re: Problem using modalPanel
            Jubril Adisa Novice

            i took out the form as suggested but its still giving the same javascript error, this is my complete JSF page code


            <%@ page language="java" pageEncoding="ISO-8859-1"%>
            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>


            <html>
            <head>
            <title>My JSF 'test.jsp' starting page</title>
            <meta http-equiv="pragma" content="no-cache">
            <meta http-equiv="cache-control" content="no-cache">
            <meta http-equiv="expires" content="0">
            <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
            <meta http-equiv="description" content="This is my page">
             <!--
            <link rel="stylesheet" type="text/css" href="styles.css">
             -->
            
            <script type="text/javascript">
            function getRightTop(ref) {
             var position = new Object();
             position.top = 0; //ref.offsetTop;
             position.left =0; // ref.offsetLeft+ref.clientWidth+6;
             return position;
             }
            </script>
            </head>
            <body>
            <f:view>
            <rich:modalPanel id="mp" minHeight="200" minWidth="450" height="200"
             width="500">
            <f:facet name="header">
            <h:outputText value="Modal Panel Title" />
            </f:facet>
            
            <h:outputText value="This is working"></h:outputText>
            </rich:modalPanel>
            </f:view>
            <a href="javascript:Richfaces.ShowModalPanel('mp',{width:450,top:200})">Hello Hi </a>
            </body>
            </html>