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

Bug 356514

Summary: Combo.getSelection() throws an exception
Product: z_Archived Reporter: Joseph Vincens <jvincens>
Component: EDTAssignee: Scott Greer <greer>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: greer, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
weather rest test none

Description Joseph Vincens CLA 2011-09-01 15:17:57 EDT
Created attachment 202633 [details]
weather rest test

deploy the attached project.
open the html on a server. Press the button.
An exception will happen on the case( serviceType.getSelection() ) (EGL line 98)

The get selection does a getAttribute() + 1, get attribute boxes the result.
Comment 1 Brian Svihovec CLA 2011-09-16 16:31:10 EDT
This blocks the RUI Technical Sample.
Comment 2 Scott Greer CLA 2011-09-26 11:17:36 EDT
(Opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=358912 to document the fact that combo boxes don't work in VE because of a deployment issue.)
Comment 3 Scott Greer CLA 2011-09-26 12:21:39 EDT
Paul,

As we discussed, the root problem seems to be there's an explicit "as int" that is being ignored in Combo.egl

    return ((getAttribute("selectedIndex") as int) + 1);   

JS gen isn't "seeing" the cast of getAttribute's returned any value to an int.


Please figure out whether you need to do anything MOF-ish with this and route it back to me when you're done....thanks!
Comment 4 Scott Greer CLA 2011-09-27 12:05:07 EDT
After failing to exhaust Paul's patience with my questions on this one, I eventually realized this really was a JS gen problem and I think the fix is not only easy, it's a good one....
Comment 5 Scott Greer CLA 2011-09-27 12:40:24 EDT
The problem was that the IntTypeTemplate was improperly treating AsExpressions that lack conversion operations by simply generating the expression -- this was just a simple bug easily fixed by making its conversion logic the same as for all the other types.
Comment 6 Joseph Vincens CLA 2011-10-03 08:53:44 EDT
verified