Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360498 - Setting data to the DataGrid component throws exception - egl.eglx.lang.TypeCastException is not a constructor
Summary: Setting data to the DataGrid component throws exception - egl.eglx.lang.TypeC...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Scott Greer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 03:12 EDT by fahua jin CLA
Modified: 2017-02-23 14:20 EST (History)
5 users (show)

See Also:


Attachments
The sample EGL file. (1.08 KB, application/octet-stream)
2011-10-11 03:15 EDT, fahua jin CLA
no flags Details
A temporary patch, need scott's review (1.33 KB, patch)
2011-10-11 22:10 EDT, Huang Ji Yong CLA
lasher: iplog+
Details | Diff

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