CheckBox behavior [message #762156] |
Wed, 07 December 2011 16:15 |
Joe Pluta 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.
|
|
|
Powered by
FUDForum. Page generated in 0.03116 seconds