Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1213 closed defect (fixed)

FIX: ContentPane was setting isLoaded even when it didn't load anything

Reported by: guest Owned by: mumme
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

This is the new loadContents that only sets isLoaded when something was actually loaded. This is needed for some ajax use-cases...

loadContents: function() {

if ( this.isLoaded ){

return;

} if ( dojo.lang.isFunction(this.handler)) {

this._runHandler(); this.isLoaded=true;

} else if ( this.href != "" ) {

this._downloadExternalContent(this.href, this.cacheContent); this.isLoaded=true;

}

},

Attachments (1)

contentpane-isloaded-fix.patch (483 bytes) - added by attila.lendvai@… 13 years ago.
svn diff to my version

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by dylan

Component: GeneralWidgets
Milestone: 0.4
Owner: changed from anonymous to bill
Version: 0.3

comment:2 Changed 13 years ago by bill

Owner: changed from bill to mumme

comment:3 Changed 13 years ago by mumme

Resolution: fixed
Status: newclosed

Fixed in r5228

comment:4 Changed 13 years ago by guest

Resolution: fixed
Status: closedreopened

Err, I may be wrong... but the fix added a final else branch and sets the isLoaded to true (i.e. when there's neither handler nor href defined).

This is right the opposite of what should happen: only set isLoaded to true when either a handler or a href attribute was found and used to load the content.

comment:5 Changed 13 years ago by attila.lendvai@…

I've run a test with the stock dojo, and now all that is breaking my app and i need to change locally is removing the else branch that sets isLoaded = true on the first invocation no matter what. I'm installing my load handler after the widget was instantiated an nothing shows up. My version of loadContents that works for me looks like this:

loadContents: function() {

if ( this.isLoaded ){

return;

} if ( dojo.lang.isFunction(this.handler)) {

this._runHandler();

} else if ( this.href != "" ) {

this._downloadExternalContent(this.href, this.cacheContent && !this.refreshOnShow);

}

},

hth,

  • attila

Changed 13 years ago by attila.lendvai@…

svn diff to my version

comment:6 Changed 13 years ago by mumme

Resolution: fixed
Status: reopenedclosed

Hi, My apologies, I somehow missed that this bug got reopened. I probably need to read my bug mail more regulary.

And you are right, I brainfarted, changing it back in r5420.

/ Fredrik

comment:7 Changed 13 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.