Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » CheckBox behavior
CheckBox behavior [message #762156] Wed, 07 December 2011 16:15
Joe Pluta is currently offline Joe PlutaFriend
Messages: 62
Registered: November 2011
Member
I'm happy to report that EDT has much more consistent behavior that RBD in the CheckBox implementation. Simple program:

import com.ibm.edt.rui.widgets.*;
import dojo.widgets.DojoCheckBox; 
  
handler CheckBoxTest type RUIhandler{initialUI = [CB1, CB2],
	onConstructionFunction = start, cssFile = "css/RUITest.css",
	title = "CheckBoxTest"} 
  
    CB1 CheckBox{text = "CB#1", onChange ::= CB1Change, onClick ::= CB1Click }; 
    CB2 DojoCheckBox{text = "CB#2", onChange ::= CB2Change, onClick ::= CB2Click }; 
  
    function start()
    end 
  
    function CB1Change(event Event in)
    	writeStdout("CB1Change");  
    end 
  
    function CB2Change(event Event in)
    	writeStdout("CB2Change");  
    end 
  
    function CB1Click(event Event in)
    	writeStdout("CB1Click");  
    end 
  
    function CB2Click(event Event in)
    	writeStdout("CB2Click");  
    end 
  
end

When you run it in EDT, you get what you expect. Click on either button and it fires both onClick and onChange exactly once. Here's what I see after clicking each checkbox once:
CB1Change
CB1Click
CB2Click
CB2Change

The order is reversed, but the event handlers are at least called in what I consider to be an intuitive manner. On RBD, it's much different. You see this instead (note that you have to change the import from "com.ibm.edt..." to "com.ibm.egl..."):
CB1Change
CB2Click
CB2Change
CB2Change

The IBM CheckBox fires only one event, the Change event. The DojoCheckBox fires THREE events: a Click followed by TWO Changes. Strange behavior, but it's not replicated in EDT, so that's a good thing! However, anybody who coded for the original behavior could get bitten by this.
Previous Topic:How Do I Clear the Internal Browser Cache?
Next Topic:Timestamps and nulls
Goto Forum:
  


Current Time: Sun Dec 21 12:04:38 GMT 2014

Powered by FUDForum. Page generated in 0.01841 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software