Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:47:53+00:00 2026-05-31T08:47:53+00:00

I am using SPring JS 2.3.0.RELEASE (which uses dojo 1.6): I tried adding widgets

  • 0

I am using SPring JS 2.3.0.RELEASE (which uses dojo 1.6): I tried adding widgets to my page but it never renders

I am using pages through tiles so here’s the layout template shopper.jspx

<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:spring="http://www.springframework.org/tags">
<jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<link rel="stylesheet" type="text/css" href="/resources/dojo/resources/dojo.css"/>
<link rel="stylesheet" type="text/css" href="/resources/dijit/themes/nihilo/nihilo.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/screen.css" />
<c:url var="rootUrl" value="/resources/"/>
<script type="text/javascript" djconfig="parseOnLoad: true" src="${rootUrl}dojo/dojo.js"><jsp:text></jsp:text> </script>
<script type="text/javascript" src="${rootUrl}spring/Spring.js">
  <jsp:text></jsp:text>
</script>
<script type="text/javascript" src="${rootUrl}spring/Spring-Dojo.js">
  <jsp:text></jsp:text>
</script>
<script type="text/javascript">
  dojo.require("dojo.parser"); 
</script>
<title>My Shopping</title>
</head>
<body class="nihilo">
  <tiles:insertAttribute name="header" />
  <tiles:insertAttribute name="submenu" />
  <tiles:insertAttribute name="body" />
  <tiles:insertAttribute name="footer" ignore="true" />
</body>
</html>

and here’s the home.jspx template which overrides body attribute

<?xml version="1.0" encoding="UTF-8" ?>
<div id="page" class="roundedCorners" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page"
  xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form">
  <jsp:directive.page contentType="text/html;charset=UTF-8" />
  <jsp:output omit-xml-declaration="yes" />
  <c:url var="rootUrl" value="/resources/"/>
  <script>
        dojo.require("dijit.layout.BorderContainer");
        dojo.require("dijit.layout.TabContainer");
        dojo.require("dijit.layout.AccordionContainer");
        dojo.require("dijit.layout.ContentPane");  
        dojo.addOnLoad(function()
            {
            // create a BorderContainer as the top widget in the hierarchy
            var bc = new dijit.layout.BorderContainer({style: "height: 100%; width: 100%;"});

            // create a ContentPane as the left pane in the BorderContainer
            var cp1 = new dijit.layout.ContentPane({
               region: "left",
               style: "height: 100px",
               content: "hello world"
            });
            bc.addChild(cp1);

            // create a TabContainer as the center pane in the BorderContainer,
            // which itself contains two children
            var tc = new dijit.layout.TabContainer({region: "center"});
            var tab1 = new dijit.layout.ContentPane({title: "tab 1"}),
                tab2 = new dijit.layout.ContentPane({title: "tab 2"});
            tc.addChild( tab1 );
            tc.addChild( tab2 );
            bc.addChild(tc);

            // put the top level widget into the document, and then call startup()
            dojo.byId("inbox").addChild(bc.domNode);
            bc.startup();
        });
    </script>  
    <div id="inbox" class="panel roundedCorners">
        <div id="inboxContainer" dojo-data-type="dijit.layout.BorderContainer">
        </div>
    </div>
</div>

I do not see any of these widgets getting rendered when I load the page. Also the browser console shows the error:

dojo.byId("inbox").addChild is not a function
[Break On This Error]   

dojo.byId("inbox").addChild(bc.domNode);

despite having the djconfig="parseOnLoad: true" configuration in place.

Update: hereś the initial declarative syntax I tried but could not get it to work.

shopper.jspx:

<html xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:tiles="http://tiles.apache.org/tags-tiles"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:spring="http://www.springframework.org/tags">
<jsp:output doctype-root-element="HTML"
    doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<link rel="stylesheet"
    href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/nihilo/nihilo.css"
    media="screen"/>
<link rel="stylesheet" type="text/css" href="/resources/css/screen.css" />
<!-- load dojo and provide config via data attribute -->
<script
    src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"
    data-dojo-config="async: true, parseOnLoad: true">
    <jsp:text></jsp:text>
</script>
<script type="text/javascript">
        dojo.require("dojo.parser");
        dojo.require("dijit.layout.BorderContainer");
        dojo.require("dijit.layout.TabContainer");
        dojo.require("dijit.layout.AccordionContainer");
        dojo.require("dijit.layout.ContentPane");
        dojo.require("dijit.layout.AccordionPane");
</script>
<title>My Shopping</title>
</head>
<body class="nihilo">
    <tiles:insertAttribute name="header" />
    <tiles:insertAttribute name="submenu" />
    <tiles:insertAttribute name="body" />
    <tiles:insertAttribute name="footer" ignore="true" />
</body>
</html>

the declarative home.jspx I copied from dojo tutorial:

<?xml version="1.0" encoding="UTF-8" ?>
<div id="page" xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page"
  xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form">
  <jsp:directive.page contentType="text/html;charset=UTF-8" />
  <jsp:output omit-xml-declaration="yes" />
    <div id="inbox" data-dojo-type="dijit.layout.BorderContainer" style="width: auto; height:auto" > 
    <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">Top pane</div>
     <div data-dojo-type="dijit.layout.AccordionContainer" data-dojo-props="region:'leading'">
          <div data-dojo-type="dijit.layout.AccordionPane" title="pane #1">accordion pane #1</div>
          <div data-dojo-type="dijit.layout.AccordionPane" title="pane #2">accordion pane #2</div>
          <div data-dojo-type="dijit.layout.AccordionPane" title="pane #3">accordion pane #3</div>
     </div>
     <div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="region:'center'">
          <div data-dojo-type="dijit.layout.ContentPane" title="tab #1">tab pane #1</div>
          <div data-dojo-type="dijit.layout.ContentPane" title="tab #2">tab pane #2</div>
          <div data-dojo-type="dijit.layout.ContentPane" title="tab #3">tab pane #3</div>
     </div>
     <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'trailing'">Trailing pane</div>
     <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">Bottom pane</div>
    </div>
</div>

in screen.css I have defined the following:

body {
  margin: 0;
  padding: 0;
  background-color: #EAECEE;
  font-family: Verdana, sans-serif;
  font-size: 12px;
}

#page {
  background: #ffffff;
  margin-left: auto;
  margin-right: auto;
  -moz-box-shadow: 0 0 5px 3px #999;
  -webkit-box-shadow: 0 0 5px 3px #999;
}

And I get no widgets rendered in when I access the page.

Fixed: Was ignoring the fact about how dijit places divs, I removed the styles applyed through “page” div id and fixed the height and width as follows:

<div xmlns:spring="http://www.springframework.org/tags" xmlns:jsp="http://java.sun.com/JSP/Page"
  xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:form="http://www.springframework.org/tags/form">
  <jsp:directive.page contentType="text/html;charset=UTF-8" />
  <jsp:output omit-xml-declaration="yes" />
    <div data-dojo-type="dijit.layout.BorderContainer" style="width: auto; height:600px;" > 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:47:54+00:00Added an answer on May 31, 2026 at 8:47 am

    You are declaring a border container in markup and also trying to create one programmatically.

    Try this:

    Change

    <div id="inboxContainer" dojo-data-type="dijit.layout.BorderContainer">
    </div>
    

    to

    <div id="inboxContainer" style="width:800px; height: 600px"></div>
    

    create the border container

    var bc = new dijit.layout.BorderContainer({}, dojo.byId("inboxContainer"));
    ...
    // dojo.byId("inbox").addChild(bc.domNode); // remove this
    

    This line of code fails because dojo.byId returns a domNode and a domNode does not have an addChild method.

    I also changed the width and height. Using height: 100% requires all the dom nodes above it in the hierarchy (html, body, roundedCorners, inbox) to also have height: 100% and I couldn’t verify in the code posted that this was the case, so eliminate this potential problem for now by specifying a direct height. Once, its working, you can change it back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a Web application using Spring 3.1.0.RELEASE, JSF 2.x, JPA 2 with Hibernate
I've been using spring for some time, but I always wondered how does it
Using Hibernate 3.6.8.Final and Spring 3.0.5.RELEASE , I'm trying to add some Common DAO
I am using Spring MVC and Spring Security version 3.0.6.RELEASE. What is the easiest
I am using Spring+Hibernate for an operation which requires creating and updating literally hundreds
I'm using Spring 3.1.0.RELEASE, Hibernate 4.0.1.Final, and MySQL 5.1. What is the pooled data
I'm working on a project which currently uses NHibernate 2.1.2, FluentNHibernate 1.1 and Spring.Net
I'm using Spring ( 3.0.5.RELEASE ) to create & manage some beans and am
I am looking at using Spring Batch , which seems to mainly be distributed/managed
I try to implement using Spring 3.1.0.RELEASE + Hibernate to make RESTful web service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.