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

Bug 359178

Summary: Wrong contents displayed in the VE for the external type widgets
Product: z_Archived Reporter: fahua jin <jinfahua>
Component: EDTAssignee: Yun Feng Ma <mayunf>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: chenzhh, huozz, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The sample project. none

Description fahua jin CLA 2011-09-28 01:49:26 EDT
Build Identifier: 0.7.0.v201109192102

1) Open the H10.egl in the attached project with VE.
2) Drag a button to the any empty cell of grid layout.
3) Another SimpleDiv is displayed in the top of the VE.
4) SimpleDiv will be ac-cumulatively added to the VE if adding any code changes.

Click refresh button will clean the SimpleDiv.

Reproducible: Always
Comment 1 fahua jin CLA 2011-09-28 01:50:13 EDT
Created attachment 204143 [details]
The sample project.
Comment 2 Brian Svihovec CLA 2011-10-26 14:20:17 EDT
This no longer seems to be happening.
Comment 3 Huo Zhen Zhong CLA 2011-10-30 23:13:07 EDT
This also happened, Yun Feng, please help to look at it. It may be a JS runtime problem.
Comment 4 Yun Feng Ma CLA 2011-10-31 02:53:15 EDT
This is not a bug of VE, the external type should have below "constructor":
	"constructor" : function() {
		this.eze$$DOMElement = document.createElement("div");
		this.eze$$DOMElement.eze$$widget = this;
		this.eze$$DOMElement.style.backgroundColor="yellow";
		this.eze$$DOMElement.innerHTML = "My default text values";		
	},


instead of below:
	"constructor" : function() {
		this.eze$$DOMElement = document.createElement("div");
		this.eze$$DOMElement.style.backgroundColor="yellow";
		this.eze$$DOMElement.innerHTML = "My default text values";		
	},
Comment 5 Yun Feng Ma CLA 2011-10-31 02:54:06 EDT
My mistake, the "constructor" should be:
	"constructor" : function() {
		this.eze$$DOMElement = egl.createElement("div");
		this.eze$$DOMElement.eze$$widget = this;
		this.eze$$DOMElement.style.backgroundColor="yellow";
		this.eze$$DOMElement.innerHTML = "My default text values";		
	},
Comment 6 fahua jin CLA 2011-10-31 03:47:45 EDT
The updated version of JS file,

egl.defineClass("org.eclipse.samplewidget", "SimpleDiv", 'eglx.ui.rui', 'Widget', {	
	"constructor" : function() {
		this.eze$$DOMElement = egl.createElement("div");
        this.eze$$DOMElement.eze$$widget = this;
		this.eze$$DOMElement.style.backgroundColor="yellow";
		this.eze$$DOMElement.innerHTML = "My default text values";		
	},
	
	"getMyText" : function() {
		return this.eze$$DOMElement.innerHTML;
	},
	  	
  	"setMyText" : function(s) {
  		this.eze$$DOMElement.innerHTML = s;
  	}
});

Verified in 0.7.0.v201110272101.