# remex(:unique_choice_lister) # $ def_slotted_exemplar(:unique_choice_lister,{},{:choice_lister}) $ _method unique_choice_lister.activate_on(a_field, a_model, an_action, _optional max_size, string_selector, select_mode) ## Populates the choice list with unique values for a_field. ## Max_size specifies the maximum number of records to search ## (default 512). Use only on physical or derived fields. f << a_field max << max_size.default(512) t << f.owner.active_collection s << sorted_set.new(max) n << 0 _for e _over t.fast_elements() _loop v << e.perform(f.name) _if v _is _unset _then _continue _endif s.add(v) n +<< 1 _if n = max _then _leave _endif _endloop _super.activate_on(s.as_simple_vector(), a_model, an_action, string_selector, select_mode) _endmethod