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

Bug 358307

Summary: Using infobus results in invalid runtime code
Product: z_Archived Reporter: Brian Svihovec <svihovec>
Component: EDTAssignee: Huang Ji Yong <hjiyong>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: greer, hjiyong, jqian
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Add support to include js file and css file
none
Fix none

Description Brian Svihovec CLA 2011-09-20 17:02:51 EDT
Create a RUIHandler with the following content:

function start()
		Infobus.subscribe("foo", sectionClicked);
	end
	
	function sectionClicked(eventName string in, data any in)
	end

When the handler is run, the contents of OpenAjax.js is displayed in the browser window.  

It appears that the usage of Infobus is resulting in an additional AJAX POST being generated into the root HTML document, but the result of that POST is not being placed in a <script> tag.
Comment 1 Scott Greer CLA 2011-09-20 18:36:23 EDT
(For what it's worth, I do run the infobus FVT tests regularly, and they run successfully, so I'm confident JS gen produces the correct code....thought I'd mention that given the potentially misleading abstract for the bug....)
Comment 2 Huang Ji Yong CLA 2011-09-28 03:51:20 EDT
Created attachment 204147 [details]
Add support to include js file and css file
Comment 3 Huang Ji Yong CLA 2011-09-28 03:53:48 EDT
This is an HTML gen problem.
Comment 4 Brian Svihovec CLA 2011-10-10 22:45:48 EDT
Import the project /org.eclipse.edt.rui.samples_0.7.0 from Kan-Sav-CVS.

When opening the file gallery.contents.egl, firebug shows that a post is being sent to load the file OpenAjax.js, and it shows that a response is returned, but the following line of code is never being executed in the HTML file:

if (xmlhttp.readyState==4) {
runHandler();  // This is NOT run
 } 

If it matters, I'm using Firefox 3.6.23.

I am also seeing similar issues with the Dojo Samples gallery - org.eclipse.edt.rui.dojo.samples_0.7.0 in the same repository.
Comment 5 Huang Ji Yong CLA 2011-10-11 02:15:23 EDT
Created attachment 204921 [details]
Fix
Comment 6 Huang Ji Yong CLA 2011-10-11 02:20:12 EDT
This bug happens in Firefox of version below 4.
The reason is that, firefox won't invoke onreadystatechange for synchronous ajax call.
Comment 7 Lisa Lasher CLA 2011-11-09 14:13:32 EST
This high severity defect was fixed several weeks ago, so I am closing.