Opened 15 years ago

Closed 14 years ago

Last modified 11 years ago

#2413 closed defect (fixed)

Dialog widget cannot use Button widget as close control

Reported by: [email protected] Owned by: koranteng
Priority: high Milestone: 0.9
Component: Dijit - Form Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


I tried to use a Button widget as a CloseControl? of a Dialog:

<div dojoType="dialog" id="myDialog" bgColor="white" bgOpacity="0.5" toggle="fade"   toggleDuration="250">
	<form onsubmit="return false;">
		<button dojoType="Button" widgetId="closeButton" id="closeButton">Cancel</button>

I have an init function that sets the CloseControl?:

	myDialog = dojo.widget.byId("myDialog");

When the dialog shows up, Cancel button does not close it. I tried to change the event linking in Dialog.js to ("onclick" replaced with "onClick"):

	dojo.event.connect(this.closeNode, "onClick", this, "hide");

Then it seems to work (the button closes the dialog).

Change History (4)

comment:1 Changed 15 years ago by [email protected]

Looks like there is a workaround - to use domNode of a widget as a CloseControl?: myDialog.setCloseControl(dojo.widget.byId("closeButton").domNode);

However this is not quite intuitive. Also, closeNode attribute in HTML does not seem to work at all if it points to a Button widget.

comment:2 Changed 15 years ago by Adam Peller

Component: WidgetsDijit
Owner: changed from bill to koranteng

comment:3 Changed 14 years ago by bill

Milestone: 0.9
Resolution: fixed
Status: newclosed

This is fixed with checkins to make Dialog extend Form. Actually you have to use a Button widget now (but that restriction will be lifted eventually I think).

comment:4 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.