Icon View Incident Report

Minor Minor
Reported By: Matthew Jones
Reported On: 1/6/2016
For: Version 2.04 Build 1
# 4388 Creating Radio Buttons Dynamically at Run-Time Causes SelectionState Property to Change

I have code to create radio buttons at run time. In the loop that is creating them, code identifies the one that should be selected, and sets it as checked. In EWB1, this worked. In EWB2, creating another radio button clears the check from the earlier one.

I can work around this by remembering the one to select until the end, but it strikes me as an imperfect situation to have the selection of another item cleared.

szItem := GetItem();
while szItem <> '' do
begin
 xRadio := DuplicateRadio(radioDetailMaster, MainPanel);

 xRadio.Caption := szItem;
 if TestSomething() then
   xRadio.SelectionState := ssSelected;

 szItem := GetItem();
end;



Comments Comments and Workarounds
The issue was the default radio button state being ssIndeterminate. When the last radio button was created, it was created with a selection state of ssIndeterminate, and a group of radio buttons can't have one ssIndeterminate and other non-ssIndeterminate selections, so it forced them *all* to ssIndeterminate.

The workaround was to not set any selection states until *after* all of the radio buttons for the group were created.

But, this behavior has been changed in 2.05 (breaking change):

Now you have to set the radio button whose SelectionState is equal to ssSelected in order for the "group" state to be changed to "indeterminate". IOW, as long as you have a "selected" radio button, you cannot change the non-selected radio button states to "indeterminate", only "selected" or "un-selected".


Resolution Resolution
Fixed Problem on 1/8/2016 in version 2.05 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image