Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14936 closed defect (invalid)

[regression] dijit.layout.ContentPane onDownloadStart will cause an error

Reported by: milad Owned by: milad
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

hi all if i put onDownloadStart attr on dijit.layout.ContentPane?,it will cause an error: Uncaught TypeError?: Cannot read property 'domNode' of undefined

Attachments (1)

tab.html (1.1 KB) - added by milad 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by milad

Attachment: tab.html added

comment:1 Changed 8 years ago by bill

Owner: set to milad
Status: newpending

Well, according to the documentation that method needs to return a string:

	onDownloadStart: function(){
		// summary:
		//		Called before download starts.
		// description:
		//		The string returned by this function will be the html
		//		that tells the user we are loading something.
		//		Override with your own function if you want to change text.
		// tags:
		//		extension
		return this.loadingMessage;
	},

So, please update your test case to do that and let us know if there's still a problem.

Alternately, maybe you want to connect to that method instead of overriding it:

<div data-dojo-type="dijit.layout.TabContainer">
   <script type="dojo/connect" data-dojo-event="onDownloadStart">
      console.log("hi");
   </script>

comment:2 Changed 8 years ago by milad

Status: pendingnew

hi
you right,if i connect it work fine.
but if my function return string this issue still happen.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">
    <head>
        <script src="dojo172/dojo/dojo.js"
        djConfig="parseOnLoad: true">
        </script>
        <script type="text/javascript">
            dojo.require("dijit.layout.TabContainer");
            dojo.require("dijit.layout.ContentPane");
        </script>
        <link rel="stylesheet" type="text/css" href="dojo172/dijit/themes/claro/claro.css"/>
		<script>
		function myFunc(arg){
			return arg;
		}
		</script>
    </head>
    <body class="claro">
		<div>
			<div doLayout="false" tabPosition="top" dojoType="dijit.layout.TabContainer" style="width: 1020px;overflow:auto;">
				<div dojoType="dijit.layout.ContentPane" title="tab0">
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
					hello<br/>
				</div>
				<div onDownloadStart="myFunc('action')" href="tab.php" preventCache="true" dojoType="dijit.layout.ContentPane" title="tab1"></div>
			</div>
		</div>
    </body>
</html>

sorry for my poor language;

comment:3 Changed 8 years ago by bill

Resolution: invalid
Status: newclosed

Your language is fine but there's a problem with your code. You still aren't returning a value. You are effectively doing:

onDownloadStart = function(){
    myFunc('action');
}

Hopefully you can see that the anonymous outer function isn't returning any value, regardless of what myFunc does.

You could just say in the markup:

onDownloadStart="return 'hi';"

to make it work.

comment:4 Changed 8 years ago by milad

i will not insist on my opinion,but can you test my first example with dojo 1.5.2?

comment:5 Changed 8 years ago by bill

OK, I tried on 1.5, and it works there, but still, it was always specified that you needed to return a string from that onDownloadStart method.

Last edited 8 years ago by bill (previous) (diff)
Note: See TracTickets for help on using tickets.