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

Bug 360498

Summary: Setting data to the DataGrid component throws exception - egl.eglx.lang.TypeCastException is not a constructor
Product: z_Archived Reporter: fahua jin <jinfahua>
Component: EDTAssignee: Scott Greer <greer>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: carrollk, chenzhh, hjiyong, jqian, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The sample EGL file.
none
A temporary patch, need scott's review lasher: iplog+

Description fahua jin CLA 2011-10-11 03:12:13 EDT
Build Identifier: 0.7.0.v201110100901

In an RUI project (should have reference to RUI & Dojo widget library), import the attached H2.egl, you will see the exception when preview it in the external browser - egl.eglx.lang.TypeCastException is not a constructor.

The data grid is a very widely used widgets. I set the severity to critical, it should be resolved as soon as possible.

Reproducible: Always
Comment 1 fahua jin CLA 2011-10-11 03:15:08 EDT
Created attachment 204923 [details]
The sample EGL file.
Comment 2 Brian Svihovec CLA 2011-10-11 09:46:41 EDT
As far as I can tell, it is not possible to assign a record[] to an any[] in JavaScript:

        recordArr recordName[] = new recordName[];
    	record1 recordName = new recordName;
    	record1.field1 = "aaaa";
    	record1.field2 = "aaaa";
    	recordArr.appendElement(record1);
    	var1 any[] = recordArr as any[];

This gives the same exception, but does not involve the usage of DataGrid.

It does not seem that there is a workaround, so I am setting this to Blocker, since it means that DataGrid is unusable.
Comment 3 Huang Ji Yong CLA 2011-10-11 22:10:14 EDT
Created attachment 204983 [details]
A temporary patch, need scott's review

Hi Scott,
I commit the temporary fix to get over this issue.
The change only affects ArrayType conversion to any ArrayType, I guess the fix won't affect other parts.
You may want to review it and make some changes later when you're back from vacation.
Thanks.
Comment 4 Scott Greer CLA 2011-10-17 23:04:30 EDT
Reviewed the fix with Ji Yong...looks good.
Comment 5 Huang Ji Yong CLA 2011-10-18 01:24:07 EDT
Reviewed by Scott.
Comment 6 fahua jin CLA 2011-10-19 21:20:57 EDT
Verified in 0.7.0.v201110180903