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

Bug 356429

Summary: The children widgets which are defined after their container can not be displayed
Product: z_Archived Reporter: Yun Feng Ma <mayunf>
Component: EDTAssignee: Project Inbox <edt.javascriptgen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: broy2, greer
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Yun Feng Ma CLA 2011-09-01 01:15:20 EDT
Build Identifier: 

For below Handler, the Button can not be displayed correctly.

handler demo9 type RUIhandler {initialUI = [ ui ],onConstructionFunction = start, cssFile="css/MyRUI9.css", title="demo9"}
	
	ui Box{  children = [ Button ] };
	Button Button{ text = "Click" };  //This Button is defined after "ui"
	
	function start()
	end
end

This is because the generated javascript sets the children of "ui" to "Button" before the "Button" is instanced. 


Reproducible: Always
Comment 1 Scott Greer CLA 2011-09-07 22:17:18 EDT
I've developed the JS gen portion of the fix, however, it also requires an IR fix so as soon as that's available I will commit my code.
Comment 2 Scott Greer CLA 2011-09-08 19:04:25 EDT
After much discussion, implemented the following:

Runtime construction consists of two phases:  default initialization of fields followed by the execution of initializer statements for fields that have them.  

In JS, default initialization will now be done in eze$$setEmpty, and initializer statements will be done in eze$$setInitial.   Generated constructors will invoke eze$$setInitial, which in turn will first invoke eze$$setEmpty before executing any initializer statements.  

This change was unit-tested by executing the FVT tests as well as by trying various handlers in VE.
Comment 3 Yun Feng Ma CLA 2011-09-19 22:18:46 EDT
Verified in 0.7.0.v201109192102. Thanks.