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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:01:00+00:00 2026-06-17T11:01:00+00:00

Observation: Inside my template of a custom widget that I’m making, there’s a line:

  • 0

Observation:

Inside my template of a custom widget that I’m making, there’s a line:

<input type="text"  data-dojo-props="placeHolder:'Search...'" data-dojo-attach-event="onchange: search"/>

This works fine as in on change, the search function of my widget is called. but the display is plain input box, not dijit’s fancy display. So I do this:

<input type="text" data-dojo-type="dijit.form.TextBox" data-dojo-props="placeHolder:'Search...'" data-dojo-attach-event="onchange: search"/>

Now, display is fine but search is not called on change. Now I did this:

<input type="text" data-dojo-type="dijit.form.TextBox" data-dojo-props="placeHolder:'Search...'" data-dojo-attach-event="onchange: random_name"/>

The whole page crashes and debugger tells me dojo could not find the function random_name in the "scope".

To give the whole code, here they are:

EDIT: in place of onchange, I’ve tried onChange, ondijitchange or any other event like ‘onclick’, ‘onClick’, ‘ondijitclick’ etc but search never gets called whatever I do in the browser.

  • 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-17T11:01:02+00:00Added an answer on June 17, 2026 at 11:01 am

    Well looking at your code, and the dojo 1.8 input example I would perhaps remove the attach event from the template and add it within the ‘startup’ function in your widget js file using dojo/on.

    So taking your ‘MainViewWidget.js’ code and your template markup, here are the amendments I would try:

    first the template change…

    <input type="text" data-dojo-type="dijit.form.TextBox" data-dojo-props="placeHolder:'Search...'" data-dojo-attach-point="inputNode"/>
    

    and the widget change…

    define(["dojo/_base/declare","dojo/dom",
            "dijit/_Widget", "dijit/_TemplatedMixin",
            "dojo/text!./templates/MainViewWidget.html",
            "dojo/on",
            "dijit/layout/TabContainer", "dijit/layout/ContentPane","dijit/layout/BorderContainer","dijit/form/TextBox", "dijit/layout/AccordionContainer"],
    
    function(declare, dom, _Widget, _TemplatedMixin, template, on){
        return declare("package.MainViewWidget", [_Widget, _TemplatedMixin], {
    
        // widgetsInTemplate: true, /*keep this false, otherwise data-dojo-attach-event attribute is a pain in the ass!*/
    
        templateString: template,
    
        constructor: function(){
        },
    
        startup: function(){
            on(this.inputNode, "change", function(){//or just have your search function here instead
                 alert('hi');
            });
        }
      });
    });
    

    You may need to use dojo’s lang.hitch for the event handler if you want to reference the widget using ‘this’ inside the ‘on’ handler.

    Hope that helps and I didnt have any typos.

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

Sidebar

Related Questions

Answer update, 12/22 : Using Peter Shor's observation that there's a homomorphism between distinct
Link to data: http://dl.dropbox.com/u/56075871/data.txt I want to divide each observation by mean for that
How can I subset the following example data frame to only return one observation
Are these nested comments allowed in a XML file? <!-- Making only one observation
The reason I am asking this is due to my observation that frameworks like
I wish to implement a "Last Observation Carried Forward" for a data set I
I have this following data: 0297144600-4799 0297485500-5599 The 0297485500-5599 based on observation always on
I have a data frame that I am running a Monte Carlo simulation on,
The minimum observation in my data is 326. But geom_freqpoly plots a frequency polygon
As per my observation, when we load the data to Oracle tables using SQL*

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.