openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

No default in RadioButtonGroup

Open jpenninkhof opened this issue 11 years ago • 4 comments

I would like to be able to show a RadioButtonGroup with none of the radiobutton preselected. Currently I'm doing this by setting the selectedIndex to number of radiobuttons (e.g. selectedIndex = 3 if there are 3 radiobuttons). As the selectedIndex is zero-bound, this number is actually out of bounds, however instead of an error message, this will clear the default selection and show only non-selected radiobuttons.

This work-around is currently mentioned inseveral answers on SDN, but it is not an officially documented feature. To make sure that this undocumented feature, which is apparently being used in several UI5 application, is not broken at a certain point in time, it would be great if this feature would be documented and supported officially.

In case this work-around is not the way to go, it might be necessary to make such feature available in another fashion.

jpenninkhof avatar Sep 01 '15 17:09 jpenninkhof

tracked internally: 1580057912

christianegoebels avatar Sep 02 '15 15:09 christianegoebels

Hi,

the functionality was implemented and will be available with the next patches for release versions 1.30 or greater. You will be able to create a sap.m.RadioButtonGroup and if you explicitly set its selectedIndex property to -1 the group will have no selection.

Regards, Marin

marinparushev avatar Sep 09 '15 12:09 marinparushev

Thanks Marin! Great job :)

jpenninkhof avatar Sep 14 '15 15:09 jpenninkhof

selectedIndex to '-1' didn't work with version 1.28.9 There will any solution for version 1.28.9?

Meenakshiithape avatar Jul 11 '17 11:07 Meenakshiithape