Opened 12 years ago

Closed 12 years ago

#3828 closed defect (invalid)

Programmatic Dialog has no closeNode

Reported by: guest Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.9
Keywords: Dialog closeNode Cc:
Blocked By: Blocking:

Description

The startup method of the Dialog class is called only when the dialog is created by HTML. Since startup() does the following:

this.connect(closeNode, "onclick", "hide");

when the dialog is created programmatically this code has no chance to run.

This does not work:

connectDialog = new dijit.Dialog ({title: "Connect to a hub", closeNode: "dlgCancel", _duration: 10}, pane);

that is clicking the "dlgCancel" button in the dialog has no effect.

This instead works:

connectDialog = new dijit.Dialog ({title: "Connect to a hub"}, pane);
connectDialog.connect (dojo.byId ("dlgCancel"), "onclick", "hide"); // why closeNode does not work in the constructor?

Change History (2)

comment:1 Changed 12 years ago by guest

More info. Dojo version: dojo-0.9.0beta OS: Linux Ubuntu 7.04 Mail: fermo111@…

comment:2 Changed 12 years ago by bill

Resolution: invalid
Status: newclosed

For widgets with a startup() method, you are required to call that method when creating the widget programatically. This is particularly true for the layout widgets (like SplitContainer?), but also applies to Dialog and TooltipDialog?.

There might be a way to refactor those two widgets to not require a startup() call, but for now you need to call startup() on the widget (when creating programatically)

Note: See TracTickets for help on using tickets.