Opened 12 years ago

Closed 11 years ago

#5840 closed defect (fixed)

ContentPane onUnload event is called on programatic tab creation

Reported by: guest Owned by: bill
Priority: high Milestone: 1.3
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

this problem happens only when I specify the href for the ContentPane?.

In ContentPane?.js file, _downloadExternalContent function calls the unload event handler.

_downloadExternalContent: function(){
	this._onUnloadHandler();
         ...

I don't know why unload event handler is there.

Test page attached.

cheers

Attachments (4)

tabs_test.html (2.2 KB) - added by guest 12 years ago.
tab1.html (9 bytes) - added by guest 12 years ago.
tab2.html (10 bytes) - added by guest 12 years ago.
5840.html (987 bytes) - added by bill 11 years ago.
simpler test case

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by guest

Attachment: tabs_test.html added

Changed 12 years ago by guest

Attachment: tab1.html added

Changed 12 years ago by guest

Attachment: tab2.html added

comment:1 Changed 12 years ago by Adam Peller

Component: GeneralDijit
Owner: changed from anonymous to mumme

just guessing, but it's probably trying to trigger unload on any content which may be getting replaced. Does this result in a problem for you? Do you have a test case?

comment:2 Changed 12 years ago by guest

Well, i am doing an action and some clean-up onUnload. In my case it was easy to do a work-around checking if an element exist before performing the action and trying to delete it. so my application works but dojo calling its onUnload event is wrong.

Do you have a test case?

I attached a minimal example to show the bug. or what do you mean by "test case"?

regards,

prajwala & eduardo

comment:3 Changed 12 years ago by Adam Peller

sorry, I see the example files now. thanks for posting them.

comment:4 Changed 11 years ago by dylan

Milestone: 1.1

comment:5 Changed 11 years ago by bill

Milestone: 1.11.2

Move all milestone 1.1 tickets to 1.2, except for reopened tickets and tickets opened after 1.1RC1 was released.

comment:6 Changed 11 years ago by bill

Milestone: 1.21.3
Owner: changed from mumme to Sam Foster

Sam can you take a look at these? Hopefully these are fixed by your refactor or you can fix them

comment:7 Changed 11 years ago by bill

Description: modified (diff)
Owner: changed from Sam Foster to bill
Status: newassigned

I've been mucking in ContentPane, might as well fix this. I think it should just check the isLoaded flag and not call the onUnload handler() if it isn't set.

Changed 11 years ago by bill

Attachment: 5840.html added

simpler test case

comment:8 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [15957]) Fixes #5840: don't call ContentPane? onUnload event on initial load of href (unless the ContentPane? initially had some content) !strict

Note: See TracTickets for help on using tickets.