setRequired(getScalarModel().isRequired());
select2Field = Select2ChoiceUtil.newSelect2Choice(ID_AUTO_COMPLETE, model, getScalarModel());
setProviderAndCurrAndPending(select2Field, getScalarModel().getActionArgsHint());
if(!getScalarModel().hasChoices()) {
final Settings settings = select2Field.getSettings();
ScalarModel scalarModel = getScalarModel();
final int minLength = scalarModel.getAutoCompleteMinLength();
settings.setMinimumInputLength(minLength);
settings.setPlaceholder(scalarModel.getName());
}
addOrReplace(select2Field);
} else {
//
// the select2Field already exists, so the widget has been rendered before. If it is