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 8523851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:31:41+00:00 2026-06-11T07:31:41+00:00

Dojo not seem to parse widget declaratively created in a template html file of

  • 0

Dojo not seem to parse widget declaratively created in a template html file of a custom widget.

But it works when I am declaratively create it in the home page where dojo configuration was done

here is the code snippet:

Home page:

<html>
<head>
<script type="text/javascript">
var dojoConfig = {
            parseOnLoad: true,
            isDebug: true,
            modulePaths : {"com.cgb":"../../../client/vtm/com/cgb"}
};
</script>
<script type="text/javascript" src="../common/dojo/dojo/dojo.js"></script>
<script type="text/javascript">
    dojo.require("dojo.parser");
    dojo.require("com.cgb.modules.deposit.step1_agreement");
    dojo.require("dojox.mobile.ScrollableView");
</script>
</head>
<body>
<div data-dojo-type="com.cgb.modules.deposit.step1_agreement"></div>
</body>
</html>

the custom widget:

dojo.provide("com.cgb.modules.deposit.step1_agreement");

dojo.require("dojo.cache");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");

dojo.require("dojox.mobile.ScrollableView");

dojo.declare("com.cgb.modules.deposit.step1_agreement", [dijit._Widget, dijit._Templated], {
    templateString: dojo.cache("com.cgb.modules.deposit", "templates/step1_agreement.html"),
    postCreate:function(){
        console.log("widget get instantiated");
    }
});

template html of the custom widget:

<div>
    <!--this widget didn't get parsed -->
    <div id="view1" dojoType="dojox.mobile.ScrollableView" height="50px">
        blah blahblah blah<br/>blah blahblah blah<br/>blah blahblah blah<br/>
        blah blahblah blah<br/>blah blahblah blah<br/>blah blahblah blah<br/>
        blah blahblah blah<br/>blah blahblah blah<br/>blah blahblah blah<br/>
    </div>
</div>

the ScrollableView widget didn’t get parsed, but when I declare it at the Home page it works. I think maybe I must miss something, please help me out.

  • 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-06-11T07:31:42+00:00Added an answer on June 11, 2026 at 7:31 am

    Since youre using dojox.mobile, youre probably in-between syntaxes with your code..

    http://dojotoolkit.org/documentation/tutorials/1.7/modules/#Defining_modules

    For future versions, where u use widgets in the template, the parameter widgetsInTemplate: true gets deprecated. In turn, include the dijit._WidgetsInTemplateMixin as a mixin of your module.

    e.g; < 1.7

    dojo.provide("com.cgb.modules.deposit.step1_agreement");
    dojo.require("...");
    dojo.declare("com.cgb.modules.deposit.step1_agreement", [dijit._Widget, dijit._Templated], {
    
    
        widgetsInTemplate: true,
    
    
        templateString: dojo.cache("com.cgb.modules.deposit", "templates/step1_agreement.html"),
        postCreate:function(){
            console.log("widget get instantiated");
        }
    });
    

    and 1.7+ ( expects module to have filename/path as module and namespace )

    define([ "dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", 
    
            "dijit/_WidgetsInTemplateMixin" ], // note latter mixin
    
        function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin){
           return declare([ _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ], {});
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using DOJO v1.7.2. I've created Datagrid in Dialog widget declaratively. I've included needed
I've been using the dojo array utilties, but I'm not entirely happy with the
I've created a custom build using the Dojo build tool including all the modules
Dojo custom widgets can be internationalized via the _templated mixin following the steps outlined
I've created a Dojo module which depends on dojox/data/JsonRestStore like this: define(my/MyRestStore, [dojo/_base/declare, dojox/data/JsonRestStore],
I'm using dojo's event delegation to connect a Tooltip widget to dynamically generated dom
I understand dojo's build system, but I'm rather new to Grails. Does anyone know
Related to my SO issue at Dojo extending dojo.dnd.Source, move not happening. Ideas? I
Is there any way to unregister callbacks from dojo.Deferred? If not why?
I am having an issue where dojo seems to be caching html and then

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.