Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358307 - Using infobus results in invalid runtime code
Summary: Using infobus results in invalid runtime code
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 17:02 EDT by Brian Svihovec CLA
Modified: 2017-02-23 14:19 EST (History)
3 users (show)

See Also:


Attachments
Add support to include js file and css file (2.31 KB, patch)
2011-09-28 03:51 EDT, Huang Ji Yong CLA
no flags Details | Diff
Fix (1.59 KB, patch)
2011-10-11 02:15 EDT, Huang Ji Yong CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.