Unchecked assignment Error

I am using uiComponents to create a new form, looking through the documentation I came up with this code:

case “CHK”:
List responseCheck = templateQuestion.getQuestion().getResponses();
CheckBoxGroup checkBoxResponse = uiComponents.create(CheckBoxGroup.class);
checkBoxResponse.setOptionsList(responseCheck);
checkBoxResponse.setCaption(templateQuestion.getQuestion().getLabel());
form.add(checkBoxResponse);
break;

I am getting an error:
Warning:(111, 61) Unchecked assignment: ‘com.haulmont.cuba.gui.components.RadioButtonGroup’ to ‘com.haulmont.cuba.gui.components.RadioButtonGroup<com.dynamoware.dynamoid.entity.Response>’

the code itself works, but it is inconsistent because of the unchecked assignment, but I can not seem to find a way to make it rin without errors.

I have another case which does not give me an error:
case “SEL”:
List responses = templateQuestion.getQuestion().getResponses();
LookupPickerField response = uiComponents.create(LookupPickerField.of(Response.class));
response.setOptionsList(responses);
response.setCaption(templateQuestion.getQuestion().getLabel());
form.add(response);
break;

Hello @arturoams!

The CheckBoxGroup component has a parameter, that corresponds to the item type that will be stored in the component (e.g. CheckBoxGroup<Response>). But uiComponents#create cannot create a parameterized component, so a warning appears. You do not need to worry about this.

The Link component does not have parameters, so a warning does not appear.

Regards,
Gleb