Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356514 - Combo.getSelection() throws an exception
Summary: Combo.getSelection() throws an exception
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Scott Greer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-01 15:17 EDT by Joseph Vincens CLA
Modified: 2017-02-23 14:17 EST (History)
2 users (show)

See Also:


Attachments
weather rest test (40.92 KB, multipart/x-zip)
2011-09-01 15:17 EDT, Joseph Vincens CLA
no flags Details

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