Opened 10 years ago

Closed 10 years ago

#9611 closed defect (invalid)

dijit.layout.ContentPane onDownloadError's return string not always shown

Reported by: Foam Head Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.3.2
Keywords: dijit ContentPane onDownloadError onContentError Cc:
Blocked By: Blocking:

Description

There are many ways to hook dijit.layout.ContentPane?'s onDownloadError. Some work as the comments imply, but others do not. The attached files demonstrate four test cases:

1d) When nothing is overriden, the default onDownloadError works correctly.

2d) When .attr('onDownloadError', ...) is used, the return string from the custom function is correctly displayed.

3d) When specifying <div dojoType="dijit.layout.ContentPane?" onDownloadError="..." ...> via markup, the custom function is called, but it's return value error message string is ignored. In fact, no error message string is written (the "Loading..." string remains). This looks like a bug.

4d) When using a dojo.connect(), the connected custom function is called, but its return value error message string is ignored. However, the default error message per 1d is displayed. This could be a bug but it could also be that onDownloadError is not designed to be dojo.connect'ed.

Notes:
*) The attached test cases include both onDownloadError and onContentError cases; d for download and c for content.

*) Bug #9263 is preventing any onContentError return string from being shown, but since onContentError and onDownloadError are both called from _onError, I assume once #9263 is fixed, it will have the exact same behavior as onDownloadError.

*) Tho untested, the usage of onDownloadStart and onDownloadEnd should be validated to ensure they don't have any similar issues.

Tested on:
Windows XP SP3
FireFox? 3.5.1 and IE 7.0.5730.11
Dojo 1.3.2

Attachments (2)

dijit-onContentError-bug.html (5.1 KB) - added by Foam Head 10 years ago.
Main file with all test cases
dijit-onContentError-bug-include.html (129 bytes) - added by Foam Head 10 years ago.
Dynamically loaded content with an intentional error for onContentError test cases

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Foam Head

Main file with all test cases

Changed 10 years ago by Foam Head

Dynamically loaded content with an intentional error for onContentError test cases

comment:1 Changed 10 years ago by bill

Resolution: invalid
Status: newclosed

3d) When specifying <div dojoType="dijit.layout.ContentPane??" onDownloadError="..." ...> via markup, the custom function is called, but it's return value error message string is ignored. In fact, no error message string is written (the "Loading..." string remains). This looks like a bug.

Are you talking about this line from your test file?

onDownloadError="myOnDownloadError(arguments[0])"

That's not returning a value, you probably want:

onDownloadError="return myOnDownloadError(arguments[0])"

4d) When using a dojo.connect(), the connected custom function is called, but its return value error message string is ignored. However, the default error message per 1d is displayed. This could be a bug but it could also be that onDownloadError is not designed to be dojo.connect'ed.

You can't return a value through a dojo.connect(). This is expected behavior. (The original function determines the return value, not the connected function.)

So... I think this is just user error. If I missed something let me know.

Note: See TracTickets for help on using tickets.