This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Dec 9, 2011, 4:38 PM
17 Posts

clientside event binding, bug or feature?

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 0
I notice that when defining clientside javascript event, the functions do not get bound to the particular element.
 
If I write clientside javascript alert(this); for an onlick event, the alert box displays "[window]", instead of the clicked element.
 
Normal old style inline code <button onclick="alert(this)">Push</button> will display button element instead.
 
Also when binding using  dojo.connect(button, "onclick", button, function () {alert(this);}) "this" will show correctly as the button element.
 
It is clear that we can always obtain the current element by using document.getElementById("#{id:ourelementid}"),  still there does not seem to be a good reason not to implement this cleanly. or is there?
 
BTW does this also that we do not have means to obtain the event object as well? say for onkeypress - is there a way to find which key has been pressed? Edited: No, ok not as bad - thisEvent will do :-)
 
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal