Opened 12 years ago

Closed 12 years ago

#4704 closed defect (invalid)

"too much recursion" error instanciating a dialog derived from "dijit.Dialog"

Reported by: guest Owned by:
Priority: high Milestone:
Component: Dijit Version: 0.9
Keywords: Cc: mannd@…
Blocked By: Blocking:

Description

I've been defining some new dialogs derived from dijit.Dialog using .9 release. I updated to the 10/10 nightly build to see how the grid integration was going. I now get "too much recursion" errors trying to instanciate my derived dialogs. Seems like _findMethod() is blowing the stack.

email: dave at photomann.com

Attachments (4)

DlgTest.js (655 bytes) - added by guest 12 years ago.
Derived dialog causes blown stack
DlgTest.html (813 bytes) - added by guest 12 years ago.
template DlgTest?.js
junk.html (1.0 KB) - added by guest 12 years ago.
test to create derived dialog (blows stack)
4704working.png (60.6 KB) - added by Douglas Hays 12 years ago.
screen shot of the user's code working

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by bill

Component: GeneralDijit
Owner: anonymous deleted

Please attach a testcase using the "Attach file" button.

Changed 12 years ago by guest

Attachment: DlgTest.js added

Derived dialog causes blown stack

Changed 12 years ago by guest

Attachment: DlgTest.html added

template DlgTest?.js

Changed 12 years ago by guest

Attachment: junk.html added

test to create derived dialog (blows stack)

comment:2 Changed 12 years ago by guest

I've added an example that causes the blown stack. This seems to effect any of our derived widgets (not just dialogs). There must be something basic I'm doing wrong. Thanks, Dave (mannd@…)

comment:3 Changed 12 years ago by guest

I'm interested when this is fixed...

comment:4 Changed 12 years ago by Douglas Hays

Cc: mannd@… added
Resolution: invalid
Status: newclosed

change

dojo.declare("kw.Dialog.DlgTest?", [dijit.Dialog, dijit._Templated],

to

dojo.declare("kw.Dialog.DlgTest?", dijit.Dialog,

comment:5 Changed 12 years ago by guest

Resolution: invalid
Status: closedreopened

I've already tried this, but if you don't mixin dijit._Templated, my derived dialog template isn't used. ie. I get an empty dialog as it's using the template from dijit.Dialog.

How should I specify the derived object's template? The following has no effect in the derived object: templatePath: dojo.moduleUrl("kw.Dialog","templates/DlgTest.html"),

Thanks for your time, -Dave (mannd@…)

Changed 12 years ago by Douglas Hays

Attachment: 4704working.png added

screen shot of the user's code working

comment:6 Changed 12 years ago by Douglas Hays

Resolution: invalid
Status: reopenedclosed

This continues to appear to be a user error. I'm using the latest trunk build, and created the kw directory structure as a sibling to dojo and dijit.
dojo/
dijit/
kw/

Dialog/

templates/

junk.html

comment:7 Changed 12 years ago by guest

Resolution: invalid
Status: closedreopened

I'm sorry to be a pain, but this only works if you modify Dialog.js and set the templateString to null. If Dialog has a templateString (as dijit core does), the derived class's templatePath is not used. I just updated to the 10/24 nightly build and get an empty dialog. Does your dialog.js not have a templateString?

comment:8 Changed 12 years ago by guest

I think I figured it out. I guess if you set templateString in the derived object to null, then the templatePath will be used. If you don't explicitly add templateString:null, to the derived class, it doesn't work. Still not sure why it would work for you unless your Dialog.js templateString is null.

Thanks for the help... I guess you can close this now.

comment:9 Changed 12 years ago by Douglas Hays

Resolution: invalid
Status: reopenedclosed

User error - subclass DlgTest?.js needed to set templateString:null

Note: See TracTickets for help on using tickets.