Opened 13 years ago

Last modified 13 years ago

#10327 closed defect

DOCTYPE BorderContainer Layout within templated widget — at Version 1

Reported by: Erikk Owned by: bill
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0b
Keywords: DOCTYPE, layout, BorderContainer, template, widget Cc:
Blocked By: Blocking:

Description (last modified by bill)

Hello,

When creating a widget from a template with a BorderContainer layout inside the template, the widget would not display at all on :

  • Firefox
  • Safari
  • Opera
  • Chrome

unless I remove the DOCTYPE line (<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd">).

On IE6, IE7 and IE8 it works both with or without DOCTYPE.

Here is the source code for the page :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
  <head>
    <title>Dojo example</title>
      <style type="text/css">
        @import "../js/dojotoolkit/dijit/themes/tundra/tundra.css";
      </style>
      
      <style type='text/css'>
        body, html {
          width:100%; height:100%; margin:0; padding:0;
        }
      </style>

      <script type="text/javascript" src="../js/dojotoolkit/dojo/dojo.js" 
              djConfig="parseOnLoad:false, isDebug: false"></script>        
      <script type="text/javascript">
          
      dojo.require( "dijit.layout.BorderContainer" );
      dojo.require( "dijit.layout.ContentPane" );
      dojo.require( "dijit._Widget" );
      dojo.require( "dijit._Templated" );
      dojo.require("dojo.parser");
          
      dojo.addOnLoad(function() {
      
        dojo.declare("test.Test",
                     [dijit._Widget, dijit._Templated], {
                     templateString: '<div>' + 
                                     '<div dojoType="dijit.layout.BorderContainer" design="sidebar" gutters="true" liveSplitters="true" id="borderContainer" style="height:100%; width:100%;">' +
                                     '<div dojoType="dijit.layout.ContentPane" splitter="true" region="leading" style="width: 100px;">Hi</div>' +
                                     '<div dojoType="dijit.layout.ContentPane" splitter="true" region="center">Hi, I am center</div>' +
                                     '</div>' +
                                     '</div>',
                     widgetsInTemplate : true
        }); 

        dojo.parser.parse();
        
        var _appli = new test.Test({}, dojo.byId("test"));  
        _appli.startup();
      
      });
    
    </script>
  </head>
   
  <body class="tundra">
        
    <div id="test"></div>
        
  </body>
</html>

Change History (2)

Changed 13 years ago by Erikk

Attachment: test.html added

comment:1 Changed 13 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: changed from anonymous to bill

I'll take a look.

I think there are some cases where the templated (widgetsInTemplate) widget needs to act as a layout widget, calling resize() on it's contained widgets... because otherwise the contained widgets try to size themselves too soon, while they are hidden. This doesn't seem like one of those cases though.

Note: See TracTickets for help on using tickets.