Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#16304 closed defect (fixed)

Declaration: cannot connect method to events

Reported by: gorgoroth Owned by: bill
Priority: undecided Milestone: 1.8.2
Component: Dijit Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:


See the Declaration example at:

The parser raises an error

dojo/parser::parse() error lang.hitch: scope["myHandler"] is null
 (scope="[Widget CustomButton, CustomButton_0]")

at row 22 of parser.js

It seems that the defined method myHandler (<script type="dojo/method" data-dojo-method="myHandler">), which is attached on the click event of the button through the data-dojo-attach-event attribute, cannot be found in the scope of the widget (though the scope reported in the error seems correct).

Change History (6)

comment:1 Changed 9 years ago by gorgoroth

comment:2 Changed 9 years ago by bill

Looks like a problem with the demo, the syntax should not be

<script type="dojo/method" data-dojo-method="myHandler">

but rather

<script type="dojo/method" data-dojo-event="myHandler">

(although admittedly the first syntax is more sensible). I'll look into it.

comment:3 Changed 9 years ago by bill

In [29913]:

fix comments and add todo for 2.0 to make syntax more sensible, refs #16304 !strict

comment:4 Changed 9 years ago by bill

Milestone: tbd1.8.2
Resolution: fixed
Status: newclosed

I fixed the syntax of the tutorial as I listed above.

comment:5 Changed 9 years ago by bill

In [30742]:

Update dijit/popup::moveOffScreen() to explicitly [re]set style.left and style.right, to avoid a horizontal scrollbar in case left or right was previously set. Also updating dijitOffScreen CSS class to use left: -9999px (or right: -9999px for RTL environments) instead of left: 50%, due to alleged problems with chrome's focus outline extending to the hidden element, and also to avoid a horizontal scrollbar in case the width of the offscreen element is >50% of the viewport width. Fixes #16304 !strict.

comment:6 Changed 8 years ago by bill

Oops, above commit was for #13604, not this ticket.

Note: See TracTickets for help on using tickets.