Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#3678 closed defect (duplicate)

Editor Widget Fails in TabContainer

Reported by: guest Owned by: liucougar
Priority: blocker Milestone:
Component: Editor Version: 0.4.2rc1
Keywords: version: 0.4.3 Cc:
Blocked By: Blocking:

Description

I have 2 tabs, and in each tab a Editor, one using <div dojoType="Editor" and one using <textarea dojoType="Editor"

When i run the code below in firefox i get the following error:

uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost:8080/XDataSystem/standard/js/dojo/src/widget/templates/richtextframe.html :: init :: line 10" data: no]

Ps, this bugs looks like bug #1301, but the solution there is not enough..

Full details:

The testcase file:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Editor2 Test Case</title>
<script type="text/javascript" src="/XDataSystem/standard/js/dojo/dojo.js"></script>
</head>
<body>


	<div id="mainTabContainer" dojoType="TabContainer" style="width: 100%; height: 70%" selectedTab="tab1" >
	
		<div id="tab1" dojoType="ContentPane" label="Tab 1" >
			<h1>First Tab</h1>
			<div  dojoType="Editor">
				I'm the first tab and my content is local.  Try clicking tab#2.  It's loading remotely.
			</div>
		</div>
		
		<div dojoType="ContentPane" label="Tab 2" style="display: none">
			<h1>I am tab 2</h1>
			<textarea  dojoType="Editor">
				I'm the first tab and my content is local.  Try clicking tab#2.  It's loading remotely.
			</textarea>
		</div>

	</div>

<textarea id="Editor"></textarea>

<script language="JavaScript" type="text/javascript">
	dojo.require("dojo.widget.TabContainer");
	dojo.require("dojo.widget.Editor");
</script>

</body>
</html>

Two errors (one for each Editor widget) with complete stacktrace from the Firebug firefox plugin:

'''uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame ::''' http://localhost:8080/XDataSystem/standard/js/dojo/src/widget/templates/richtextframe.html :: init :: line 10" data: no]
getBorderBox(null)dojo.js (line 5788)
getMarginBox(null)dojo.js (line 5818)
getModulePrefix(undefined, undefined)dojo.js (line 178)
(no name)()dojo.js (line 188)
loadUri([Widget dojo:editor, dojo_Editor_0] children=[0] extraArgs=Object contentFilters=[0])dojo.js (line 204)
forEach([[Widget dojo:editor, dojo_Editor_0] children=[0] extraArgs=Object contentFilters=[0]], function(), undefined)dojo.js (line 1583)
(no name)()dojo.js (line 202)
(no name)(1262, 22)dojo.js (line 195)
getName()dojo.js (line 157)
(no name)()dojo.js (line 191)
(no name)()dojo.js (line 348)
run()dojo.js (line 3543)
(no name)()dojo.js (line 3397)
(no name)()dojo.js (line 259)
loaded()dojo.js (line 239)
callLoaded()dojo.js (line 295)
modulesLoaded()dojo.js (line 288)
dj_load_init(load )dojo.js (line 851)
[Break on this error] undefined
uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost:8080/XDataSystem/standard/js/dojo/src/widget/templates/richtextframe.html :: init :: line 10" data: no]

The main cause, i think: The script tries to turn designMode property on while the element is invisible ( hidden by the tabcontainer ). This results in the error, but when i solve this using the solution describe in bug #1301: http://trac.dojotoolkit.org/ticket/1301 i get the following exception:

[Exception... "'Error: node has no properties' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]

PS: I am willingly to investigate this bug: i am using the Editor component alot in my system that i am working on.. Contact me @ tjerk _AT_ wolterinkwebdesign.com

Liocuigar (possibly misspelled ) thanks for this usefull widget!

Change History (2)

comment:1 Changed 12 years ago by liucougar

Resolution: duplicate
Status: newclosed

dup of #1301

comment:2 Changed 12 years ago by (none)

Milestone: 0.4.4

Milestone 0.4.4 deleted

Note: See TracTickets for help on using tickets.