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

Bug 355238

Summary: Used UI to Deploy RUI Project and getting egl_contextRoot is not defined when open generated HTML in Browser
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Yun Feng Ma <mayunf>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: chenzhh
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Kathy Carroll CLA 2011-08-19 11:56:19 EDT
I'm working from a development image.  I have all the projects from the eclipse CVS and org.eclipse.edt.runtime.javascript from IBM.

I'm trying to create and deploy a simple hello world RUI app.  Since I don't have access to any widgets, I'm just using writeStdOut in the start function.  I verified the scenario works as desired in RBD.

Here are the steps to recreate:

1. Define a tomcat server
2. Create a new web client project
3. Create a new RUI handler
4. Edit the rui handler to remove the UI specific stuff and add writeStdOut
handler Greetings type RUIhandler { onConstructionFunction = start, cssFile="css/AgainREDO3.css", title="Greetings"}
	function start()
		syslib.writeStdout("This is another test");
	end	
end
5. Open the dd file and specify new target project
6. Verify only one locale setting is selected on RUI Deployment Page ... don't make any changes
7. Save the DD changes without closing file
8. Select the Deploy Descriptor Icon
9. Open html file in Web Browser


Using Firebug I get this error message

egl_contextRoot is not defined

for this section of code in my generated Greetings-es_ES.html file

egl.eze$$loadScript = function(url, callback){
var script = document.createElement("script");
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function(){
callback();
};
script.onerror = function(){
console.log("load " + this.src + " fail");
}
}
script.src = "/" + egl__contextRoot + "/" + url;
document.getElementsByTagName("head")[0].appendChild(script);
};
Comment 1 Yun Feng Ma CLA 2011-08-22 01:46:36 EDT
Created attachment 201888 [details]
Patch

Changed the context root variable name to "egl__contextRoot". Thanks.
Comment 2 Tony Chen CLA 2011-08-22 07:01:43 EDT
code committed
Comment 3 Yun Feng Ma CLA 2011-08-23 05:46:41 EDT
Fixed. Please verify. Thanks.
Comment 4 Kathy Carroll CLA 2011-08-23 08:43:33 EDT
Verified
Comment 5 Lisa Lasher CLA 2011-10-11 16:25:57 EDT
Closing this defect.