DAL's Select2 integration now defines a createTag function for tags mode and marks client-created tags with newTag: true. The result template shows new tags as Create "value" while the selected value remains the raw tag text.
If you have copied or replaced autocomplete_light/select2.js, you must add equivalent handling for createTag:
var createTagFn = null;
if (use_tags) {
createTagFn = function(params) {
var term = $.trim(params.term);
if (!term) return null;
return {id: term, text: term, newTag: true};
};
}
$element.select2({
tags: use_tags,
createTag: createTagFn,
// keep your other DAL options
});
When overriding templateResult or templateSelection, you must handle item.newTag (to display the create label) and item.create_id (the server-side marker).