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

Bug 363132

Summary: EventHandler and Button_onClick are not compatible types in the expression onClick=Button_onClick
Product: z_Archived Reporter: stijn papp <stijn_papp>
Component: EDTAssignee: Tony Chen <chenzhh>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: chenzhh, smythew
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description stijn papp CLA 2011-11-08 04:24:09 EST
Build Identifier: 20110916-0149

I made a simple RUI handler with a textfield and a button. There is an onClick handler on the button. At first it didn't give any problems, but when I made a second RUI handler the error that's in the topic appeared. 
         handler testhandler type RUIhandler{initialUI =[ui
            ], onConstructionFunction = start, cssFile = "css/trtedf.css", title = "testhandler"}

    ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children = [ Button, TextField ]};
    TextField TextField{ layoutData = new GridLayoutData{ row = 1, column = 1 }};
    Button DojoButton{ layoutData = new GridLayoutData{ row = 1, column = 2 }, text = "Button",
    	color = "Blue", onClick ::= Button_onClick };

    function start()
    end
    
    function Button_onClick(event Event in)
    	
    end
end



Reproducible: Couldn't Reproduce
Comment 1 Tony Chen CLA 2011-11-08 05:40:09 EST
Stijn, 

The code in description worked fine in nightly build. What build are you using? 

The problem description in the subject of this bug was saying onClick=Button_onClick, this, however is an incorrect assignment because onClick is an array of EventHandler while Button_onClick is an EventHandler. 

To append to an array, you may use
   onClick ::= Button_onClick  

To assign value to an array, you may use
   onClick = [Button_onClick]

The code you pasted is correct since it is using the array append operator ::=
Comment 2 stijn papp CLA 2011-11-08 06:44:58 EST
I've used the milestone build that was online on 07/11/2011 (Version: Indigo Service Release 1 , Build id: 20110916-0149). I didn't write any of the code though, all of it came from drag and drop, even the event. I tried the changes you suggested, and it works that way, but the event doesn't get created that way if you add one in the properties. The javascript notation is still used.
Comment 3 stijn papp CLA 2011-11-08 08:09:20 EST
I've used the milestone build that was online on 07/11/2011 (Version: Indigo Service Release 1 , Build id: 20110916-0149). I didn't write any of the code though, all of it came from drag and drop, even the event. I tried the changes you suggested, and it works that way, but the event doesn't get created that way if you add one in the properties. The javascript notation is still used.
Comment 4 Tony Chen CLA 2011-11-08 21:00:16 EST
20110916-0149 was a very old version. I recommend you use either the M3 build or the nightly build. 

The download page is here http://eclipse.org/edt/download/

Nightly build (comparing with M3 build) contains more fixes and performance improvement, but maybe not as stable as M3 because code is delivered everyday. 

Can you try with one of the recommend build and see if the problem still exists.
Comment 5 Tony Chen CLA 2011-11-10 20:50:06 EST
Resolve the bug since the latest build works fine for this.
Comment 6 Lisa Lasher CLA 2012-04-04 22:16:21 EDT
This bug was fixed in 0.7