Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363547

Summary: document.write still occurs in VE design
Product: z_Archived Reporter: Will Smythe <smythew>
Component: EDTAssignee: Huo Zhen Zhong <huozz>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chenzhh, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Will Smythe CLA 2011-11-10 21:18:19 EST
To recreate:
1. Create a new RUI/web project
2. Create a handler and drop a widget (any widget) onto the Design page
3. Go to the project's build path and uncheck something - e.g. the RUI widgets project dependency
4. A compile error occurs in the handler (which makes sense) and a 'Compile error' message appears in the VE.
5. Go back to the project's build path settings and re-add the RUI widgets project 
6. Compile error goes away (as expected), but the VE design page now says:
document.write("Could not open /xxx/yyy.html")

I swear we have had and fixed this problem a few times now in RBD/CE, and it has founds its way now into EDT ;)
Comment 1 Tony Chen CLA 2011-11-11 01:53:01 EST
The problem should be somewhere in the ErrorHTMLGenerator which generates readable error page if there's any compiling errors before we render VE. This ErrorHTMLGenerator, as all other generators do, are re-written with the new generator framework. 

Assigning to Forest.
Comment 2 Huo Zhen Zhong CLA 2011-11-11 02:10:01 EST
Reopen VE can work around it, as there are other important defects, so leave this one to be fixed in EDT 1.0
Comment 3 Will Smythe CLA 2011-11-16 13:18:14 EST
This same issue occurs if you open a handler in the VE while the workspace is building (like on new project creation).
Comment 4 Will Smythe CLA 2011-11-16 13:24:51 EST
I *believe* the following was the exception that occurred when I got the error opening the VE while the workspace was still building ...

java.lang.UnsupportedOperationException
	at org.eclipse.edt.mof.egl.lookup.ProxyPart.accept(ProxyPart.java:132)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:230)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:243)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:230)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:243)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:230)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.impl.InternalEObject.visitChildren(InternalEObject.java:243)
	at org.eclipse.edt.mof.impl.InternalEObject.accept(InternalEObject.java:208)
	at org.eclipse.edt.mof.egl.utils.CompoundConditionExpander.<init>(CompoundConditionExpander.java:114)
	at org.eclipse.edt.ide.compiler.gen.JavaScriptGenerator.preprocess(JavaScriptGenerator.java:40)
	at org.eclipse.edt.gen.javascriptdev.ide.JavaScriptDevGenerator.generate(JavaScriptDevGenerator.java:31)
	at org.eclipse.edt.ide.rui.utils.WorkingCopyGenerationOperation.generateParts(WorkingCopyGenerationOperation.java:158)
	at org.eclipse.edt.ide.rui.utils.WorkingCopyGenerationOperation.generate(WorkingCopyGenerationOperation.java:131)
	at org.eclipse.edt.ide.rui.utils.JavaScriptPreviewGenerator.generateJavaScript(JavaScriptPreviewGenerator.java:121)
	at org.eclipse.edt.ide.rui.server.EvEditorProvider.generateJavaScript(EvEditorProvider.java:311)
	at org.eclipse.edt.ide.rui.visualeditor.internal.editor.EvEditor.generateJavaScript(EvEditor.java:910)
	at org.eclipse.edt.ide.rui.visualeditor.internal.editor.EvEditor.updateBrowsers(EvEditor.java:1646)
	at org.eclipse.edt.ide.rui.visualeditor.internal.editor.EvEditor.createPages(EvEditor.java:297)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
Comment 5 Huo Zhen Zhong CLA 2012-02-17 04:57:16 EST
Fix this defect will need to change lots of code, also need a full test, there is no time in I2, suggest to move it to I3
Comment 6 Huo Zhen Zhong CLA 2012-03-01 01:31:54 EST
Have fixed all the conditions include:
1. re-add dependent project
2. open VE when clean the projects

But there is little problem, that is, when re-add the dependent project, the widgets can shown in VE again, but user can not select them, after user refresh VE, user can select the widgets again. Bug 372936 has been reported to Jeff for this problem.