Loading ...
Sorry, an error occurred while loading the content.

Resize returns Error "style is null or not an object

Expand Messages
  • jms_scharber
    I m trying to open multible panels for an application. When I hard code the element names / object references things work fine. When I put them in an array
    Message 1 of 3 , Dec 1, 2008
    • 0 Attachment
      I'm trying to open multible panels for an application. When I hard
      code the element names / object references things work fine. When I put
      them in an array everything works except the YAHOO.util.Resize method.
      If I comment that out things work good. Am I missing something in the
      mark up?

      Thanks

      /jms



      function search() {
      var ns = EHOAHE.sd.scNSessions.length;
      EHOAHE.sd.scNWinname[ns] = 'searchwin'+ns;
      //Need to insert window in the DOM
      var referenceNode = 'searchwin';


      var markup = '<div id=\"' + EHOAHE.sd.scNWinname[ns] +
      '\"></div>';
      markup = markup + '<div class=\"hd\"></div>';
      markup = markup + '<div class=\"bd\"></div>';
      markup = markup + '<div class=\"ft\"></div>';
      markup = markup + '</div>';

      var el = YAHOO.util.Dom.get ( referenceNode );
      var status = YAHOO.util.Dom.insertAfter ( markup , el );

      EHOAHE.sd.scNSessions[ns] = new
      YAHOO.widget.Panel(EHOAHE.sd.scNWinname[ns], {
      constraintoviewport: true,
      fixedcenter: true,
      width: "500px",
      height: "400px",
      draggable: true,
      autofillheight: "body",
      zindex: 1
      }
      );

      EHOAHE.sd.scNSessions[ns].setHeader("Search Window
      Session [" + ns +"]");

      var resize = new YAHOO.util.Resize(EHOAHE.sd.scNSessions[ns], {
      handles: ['br'],
      autoRatio: false,
      draggable: true,
      ghost: true,
      proxy: true,
      status: false
      });
      /*
      resize.on('resize', function(args) {
      var panelHeight = args.height;
      this.cfg.setProperty("height", panelHeight + "px");
      }, EHOAHE.sd.scNSessions[ns], true);
      */
      EHOAHE.sd.scNSessions[ns].setBody("HI");
      EHOAHE.sd.scNSessions[ns].render(document.body);

      }
    • Dav Glass
      jms -- It s hard to tell from the code pasted, can you please post a link to a working/breaking example? Thanks Dav -- Dav Glass davglass@gmail.com
      Message 2 of 3 , Dec 1, 2008
      • 0 Attachment
        jms --

        It's hard to tell from the code pasted, can you please post a link to a working/breaking example?

        Thanks
        Dav

        --
        Dav Glass
        davglass@...
        blog.davglass.com


        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
           without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
          McDonalds Certified Food Specialist is to fine cuisine  +


        On Mon, Dec 1, 2008 at 6:27 PM, jms_scharber <john@...> wrote:


        I'm trying to open multible panels for an application. When I hard
        code the element names / object references things work fine. When I put
        them in an array everything works except the YAHOO.util.Resize method.
        If I comment that out things work good. Am I missing something in the
        mark up?

        Thanks

        /jms

        function search() {
        var ns = EHOAHE.sd.scNSessions.length;
        EHOAHE.sd.scNWinname[ns] = 'searchwin'+ns;
        //Need to insert window in the DOM
        var referenceNode = 'searchwin';

        var markup = '<div id=\"' + EHOAHE.sd.scNWinname[ns] +
        '\"></div>';
        markup = markup + '<div class=\"hd\"></div>';
        markup = markup + '<div class=\"bd\"></div>';
        markup = markup + '<div class=\"ft\"></div>';
        markup = markup + '</div>';

        var el = YAHOO.util.Dom.get ( referenceNode );
        var status = YAHOO.util.Dom.insertAfter ( markup , el );

        EHOAHE.sd.scNSessions[ns] = new
        YAHOO.widget.Panel(EHOAHE.sd.scNWinname[ns], {
        constraintoviewport: true,
        fixedcenter: true,
        width: "500px",
        height: "400px",
        draggable: true,
        autofillheight: "body",
        zindex: 1
        }
        );

        EHOAHE.sd.scNSessions[ns].setHeader("Search Window
        Session [" + ns +"]");

        var resize = new YAHOO.util.Resize(EHOAHE.sd.scNSessions[ns], {
        handles: ['br'],
        autoRatio: false,
        draggable: true,
        ghost: true,
        proxy: true,
        status: false
        });
        /*
        resize.on('resize', function(args) {
        var panelHeight = args.height;
        this.cfg.setProperty("height", panelHeight + "px");
        }, EHOAHE.sd.scNSessions[ns], true);
        */
        EHOAHE.sd.scNSessions[ns].setBody("HI");
        EHOAHE.sd.scNSessions[ns].render(document.body);

        }


      • John Scharber
        Well here is some more data, the line of code that fails is default:var R=Q.currentStyle?Q.currentStyle[S]:null;return(Q.style[S]||R);}}; in yahoo-dom.event.js
        Message 3 of 3 , Dec 3, 2008
        • 0 Attachment
          Well here is some more data, the line of code that fails is

          default:var R=Q.currentStyle?Q.currentStyle[S]:null;return(Q.style[S]||R);}};

          in yahoo-dom.event.js

          Q.style does not exist in the Panel object and R is set to null which makes sense since Q.currentlyStyle does not exist.

          When I do

           var oPanel = new YAHOO.widget.Panel('windowname', {
                                                      constraintoviewport: true,
                        position: "dynamic",
                                                      width: "500px",
                        height: "400px",
                        monitorresize: true,
                        xy: [(ns*10), (ns*10)],
                        autofillheight: "body",
                                                      zindex: 1
                                                  });

           oPanel.setHeader("Search Window Session [" + ns +"]");

               
                 var resize = new YAHOO.util.Resize(oPanel, {
                       handles: ['br'],
                       autoRatio: false,
                draggable: true,
                ghost: true,
                proxy: true,
                       status: false
                  });
               


          It works fine, its when I use a array to set the panel element name and hold the object that things break

           EHOAHE.sd.scNSessions[ns] = new YAHOO.widget.Panel(EHOAHE.sd.scNWinname[ns], {
                                                      constraintoviewport: true,
                        position: "dynamic",
                                                      width: "500px",
                        height: "400px",
                        monitorresize: true,
                        xy: [(ns*10), (ns*10)],
                        autofillheight: "body",
                                                      zindex: 1
                                                  });

           EHOAHE.sd.scNSessions[ns].setHeader("Search Window Session [" + ns +"]");

               
                 var resize = new YAHOO.util.Resize(EHOAHE.sd.scNSessions[ns], {
                       handles: ['br'],
                       autoRatio: false,
                draggable: true,
                ghost: true,
                proxy: true,
                       status: false
                  });

          So it appears that there is some instantiation issue?

          Thanks

          /jms


               

          On Mon, Dec 1, 2008 at 7:01 PM, Dav Glass <davglass@...> wrote:

          jms --

          It's hard to tell from the code pasted, can you please post a link to a working/breaking example?

          Thanks
          Dav

          --
          Dav Glass
          davglass@...
          blog.davglass.com


          + Windows: n. - The most successful computer virus, ever. +
          + A computer without a Microsoft operating system is like a dog
             without bricks tied to its head +
          + A Microsoft Certified Systems Engineer is to computing what a
            McDonalds Certified Food Specialist is to fine cuisine  +




          On Mon, Dec 1, 2008 at 6:27 PM, jms_scharber <john@...> wrote:


          I'm trying to open multible panels for an application. When I hard
          code the element names / object references things work fine. When I put
          them in an array everything works except the YAHOO.util.Resize method.
          If I comment that out things work good. Am I missing something in the
          mark up?

          Thanks

          /jms

          function search() {
          var ns = EHOAHE.sd.scNSessions.length;
          EHOAHE.sd.scNWinname[ns] = 'searchwin'+ns;
          //Need to insert window in the DOM
          var referenceNode = 'searchwin';

          var markup = '<div id=\"' + EHOAHE.sd.scNWinname[ns] +
          '\"></div>';
          markup = markup + '<div class=\"hd\"></div>';
          markup = markup + '<div class=\"bd\"></div>';
          markup = markup + '<div class=\"ft\"></div>';
          markup = markup + '</div>';

          var el = YAHOO.util.Dom.get ( referenceNode );
          var status = YAHOO.util.Dom.insertAfter ( markup , el );

          EHOAHE.sd.scNSessions[ns] = new
          YAHOO.widget.Panel(EHOAHE.sd.scNWinname[ns], {
          constraintoviewport: true,
          fixedcenter: true,
          width: "500px",
          height: "400px",
          draggable: true,
          autofillheight: "body",
          zindex: 1
          }
          );

          EHOAHE.sd.scNSessions[ns].setHeader("Search Window
          Session [" + ns +"]");

          var resize = new YAHOO.util.Resize(EHOAHE.sd.scNSessions[ns], {
          handles: ['br'],
          autoRatio: false,
          draggable: true,
          ghost: true,
          proxy: true,
          status: false
          });
          /*
          resize.on('resize', function(args) {
          var panelHeight = args.height;
          this.cfg.setProperty("height", panelHeight + "px");
          }, EHOAHE.sd.scNSessions[ns], true);
          */
          EHOAHE.sd.scNSessions[ns].setBody("HI");
          EHOAHE.sd.scNSessions[ns].render(document.body);

          }





          --
          John Scharber
          CEO/CTO
          Logic Infusion, Inc.
          Cell: (925) 200-7231
          Fax: (530) 621-3378
          www.logic-infusion.com
        Your message has been successfully submitted and would be delivered to recipients shortly.