/** Associates the radiogroup to this radio component. * The radio automatically belongs to the nearest ancestral radiogroup. * Use this method only if the radio group is not one of its ancestors. * @since 5.0.4 */ public void setRadiogroup(Radiogroup radiogroup) { boolean inGroup = _groupId != null; _groupId = null; if (inGroup || radiogroup != _group) { _explictGroup = radiogroup != null; if (_group != null) { _group.removeExternal(this); _attachExternal = false; } _group = radiogroup; //ZK-1073 it's better not to add the external when component is not attached. if (_group != null && getDesktop() != null) { _group.addExternal(this); _attachExternal = true; } smartUpdate("radiogroup", _group); } }