6 Replies Latest reply on Nov 21, 2009 12:40 PM by hevsys

    cfwindow CF8

    Ronsweb
      Does anyone know how to show a cfwindow with a javascript onload event. Coldfusion 8 is throwing an
      error with the following code.

      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitled Document</title>
      </head>
      <script language="JavaScript" type="text/javascript">
      var showlogin = function(){
      ColdFusion.Window.show('loginWindow');
      }
      </script>
      <body onload="showlogin();">

      <cflogin>
      <cfwindow name="loginWindow" center="true" closable="true"
      draggable="false" modal="true"
      title="Please login to use this system"
      headerstyle="background-color:##000000;font-family:Arial; font-size:13px;"
      initshow="false" width="450" height="300" source="login.cfm">
      </cfwindow>
      </cflogin>

      <!--- END Authentication System --->
      </body>
      </html>


      Thanks.

      Ron
        • 1. Re: cfwindow CF8
          Level 7
          your code shows the cfwindow on page's load in my tests without a problem...
          --

          Azadi Saryev
          Sabai-dee.com
          http://www.sabai-dee.com
          • 2. Re: cfwindow CF8
            Ronsweb Level 1
            Azadi,

            It is throwing a javascript error.
            In your internet options in IE under advanced; uncheck disable script debugging.

            It will throw an javascript error.

            Thanks.

            Ron
            • 3. Re: cfwindow CF8
              Level 7
              Ronsweb wrote:
              > Azadi,
              >
              > It is throwing a javascript error.
              > In your internet options in IE under advanced; uncheck disable script debugging.
              >
              > It will throw an javascript error.
              >
              > Thanks.
              >
              > Ron
              >

              hmm... i see what you mean.... it seems to error only in IE, though...
              every other browser (well, FF, Safari, Opera and Netscape) show the
              window no problem...

              IE complains about line 90 in /CFIDE/scripts/ajax/package/cfajax.js
              file... not sure why...

              as a workaround, any reason you can't use initshow="true" in your
              <cfwindow> tag?

              --

              Azadi Saryev
              Sabai-dee.com
              http://www.sabai-dee.com
              • 4. Re: cfwindow CF8
                hevsys

                Yes, you are correct if you use the initShow="true" this will resolve your issue. But consider this, I wanted to refresh a page after the window closes

                so I started with.

                 

                <script>
                function wrefresh() {
                    location.href = 'refresh.cfm';
                }

                 

                function  wload() {
                    ColdFusion.Window.onHide('register', wrefresh);
                }
                </script>

                 

                and I called from the body tag just as the author did the difference is I was calling from a button on the page, I do not want the

                window to load by default. I too got the line 90 error in IE. Resolution was not to call the open window from the button, to call

                the javascript from the button and add the show window to it. Load nothing on the body tag.

                 

                <script>
                function wrefresh() {
                    location.href = 'refresh.cfm';
                }

                 

                function  wload() {
                    ColdFusion.Window.show('register');
                    ColdFusion.Window.onHide('register', wrefresh);
                }
                </script>

                <a href="##" id="menu_link" onclick="wload();">

                 

                Posting for reference.

                • 5. Re: cfwindow CF8
                  injun [576871] Level 1

                  Hi!

                  In cfwindow tag change initshow=false to initshow=true

                   

                  And all be OK

                  • 6. Re: cfwindow CF8
                    hevsys Level 1

                    Hi, Sorry you missed the point that I did NOT want the page

                    to load by default. I have no issue, just posted my resolution in this thread

                    for reference.