Opened 10 years ago

Closed 10 years ago

#9121 closed defect (fixed)

ContentPane: downloads href content twice

Reported by: anthonywatson Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I recently changed from Dojo 1.2.3 to 1.3. I have a dijit.Dialog defined in markup on my page and I am using the href attribute. Using the Firebug console, I call myDialog.refresh() and I can see that an HTTP GET is happening to download the content for the Dialog. The problem is, when I call myDialog.show(), I can see the HTTP GET is happening again even though the content was already downloaded when I called refresh(). When I revert back to Dojo 1.2.3, I only see one HTTP GET for refresh() and I do not see a second HTTP GET when I call show(). I am not sure if the problem is with Dialog or ContentPane.

Attachments (1)

dojoDialog.html (1.3 KB) - added by anthonywatson 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by anthonywatson

Attachment: dojoDialog.html added

comment:1 Changed 10 years ago by anthonywatson

I uploaded a sample HTML file that demonstrates the problem but to use it you will need to change the href of the dialog before testing it.

comment:2 Changed 10 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Milestone: tbd1.4
Owner: changed from anonymous to bill
Status: newassigned
Summary: Dialog Downloads Href Content TwiceDialog: downloads href content twice

OK, I'll take a look, may be related to #8969.

comment:3 Changed 10 years ago by anthonywatson

I tracked the bug down to the _loadCheck function of ContentPane?.js. When I run my debugger on this function, I see that this._hrefChanged is true even after I have already called refresh() once and so refresh() is called a second time in the _loadCheck function. If the href is set in markup and parsed on load and then I programmatically call refresh(), I don't think this._hrefChanged should still be true when I later call show() because the href has not changed since I called refresh() the first time.

If I call refresh() once, then set my dialog's _hrefChanged property to false, then call show(), I see that the double-download problem is fixed.

comment:4 Changed 10 years ago by bill

Summary: Dialog: downloads href content twiceContentPane: downloads href content twice

Also reported in #9179, will fix now.

comment:5 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [17376]) refresh() should clear the this._hrefChanged flag, since that's really a flag to indicate that a load is needed.

Also moved some code from _setContents() to destroyDescendants() about erasing state information about the contents.

Fixes #9121, #9179 !strict.

Note: See TracTickets for help on using tickets.