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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:05:23+00:00 2026-05-24T04:05:23+00:00

First off, I am using a version of older version of dojo, so dojo.event.connect

  • 0

First off, I am using a version of older version of dojo, so dojo.event.connect is the proper syntax. My question is this: How do I access the event in the function that I call when the event is fired.

Basically, Ii am dynamically creating a button and then connecting an event on “onClick”

var _btn = dojo.widget.createWidget(widget parameters);
dojo.event.connect(_btn,"onClick","myFunction");

In myFunction, I need to be able to access the attributes of _btn. I have tried passing _btn as the context of dojo.event.connect but this doesn’t work. It also wont pass _btn as a parameter for myFunction when I try that. Is it possible to either A) somehow pass _btn as a parameter into myFunction or B) Access the event that is fired in myFunction when _btn is clicked.

  • 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-24T04:05:24+00:00Added an answer on May 24, 2026 at 4:05 am

    I don’t know if there is a more convenient way to solve your problem, but in the worst case, you could just use a closure as a surefire way to pass the parameter:

    change myfunction from

    myfunction(arg1, arg2){
    

    into

    myfunction(btn, arg1, arg2){
         //using btn here
    

    and use dojo.partial (or dojo.hitch) to create a function that always reveives a certain button as a parameter (and then pass it to the connect):

    dojo.event.connect(_btn, 'onClick', dojo.partial(myFunction, _btn));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a strange occurrence to be sure. First off, I'm using Chrome version
First off, the version of MYSQL I'm using is 5.1.66-community-log . Now that we
First off, I'm using an older version of Restlet (1.1). Secondly, I'm not sure
First off I want to say that I am not using threads or multiple
First off, here is the situation. I'm using a guild hosting site that allows
First off, I'm using version 3.7.1 with a jQuery UI framework theme. I'm trying
First off, sorry for the cryptic question. My team is currently using Selenium 2.0rc3
First off, I want to say that yes, I do know that doing this
This question is a spin-off from this one . Some history: when I first
First off, I'm using XCode 4.0.2. Okay, here is my issue. I can build

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.