Opened 11 years ago

Closed 11 years ago

#7494 closed defect (fixed)

ContentPane: _loadCheck function not checking isLoaded when preload true

Reported by: mathew Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 1.1.1
Keywords: ContentPane _loadCheck Cc:
Blocked By: Blocking:

Description

The _loadCheck function in dijit.layout.ContentPane has the following logic:

if(this.href &&	
	(forceLoad ||
	(this.preload && !this._xhrDfd) ||
	(this.refreshOnShow && displayState && !this._xhrDfd) ||
	(!this.isLoaded && displayState && !this._xhrDfd)
)

If the show function in dijit.Dialog is called when preload is true, it is likely that content has already been loaded, but the if test ignores isLoaded flag. _xhrDfd will be undefined, unless a download is in progress as it is deleted when the download completes.

I suggest that the line:

(this.preload && !this._xhrDfd) ||

is changed to:

(this.preload && !this.isLoaded && !this._xhrDfd) ||

Change History (4)

comment:1 Changed 11 years ago by bill

Hi. Can you explain why this is special for Dialog? (Or does it happen for plain ContentPane too?)

comment:2 in reply to:  1 Changed 11 years ago by mathew

Replying to bill:

Hi. Can you explain why this is special for Dialog? (Or does it happen for plain ContentPane too?)

I came across this issue in the context of working with a Dialog, so that is the reason I mentioned it. I haven't tested it for a plain ContentPane?, but I guess it will probably affect a ContentPane? as well.

comment:3 Changed 11 years ago by bill

Milestone: tbd1.2
Owner: set to bill
Status: newassigned
Summary: ContentPane _loadCheck function not checking isLoaded when preload trueContentPane: _loadCheck function not checking isLoaded when preload true

OK. I'll check in this change, although there's something weird in ContentPane.js in that it's calling _loadCheck() twice, once in startup() and once in postCreate(). Should research that at some point.

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [14931]) Fixes #7494: #7494: ContentPane? _loadCheck function not checking isLoaded when preload true !strict

Note: See TracTickets for help on using tickets.