Group Picker
Select APPNETOS user groups using the complete Document Picker workflow and group-specific defaults.
A ready-made picker for user groups
Group Picker extends Document Picker. It inherits AJAX loading, pagination, search, sorting, selection callbacks, optional exclusions and reusable templates, while supplying group-specific defaults.
This makes selecting APPNETOS user groups a small integration task rather than a separate search-and-selection interface to build.
Default group configuration
The default picker identifier is group-picker. Results show the group name
and
active state; the active column uses boolean rendering. Group names are searchable and
can
be sorted in ascending or descending order. The default selection mode is inherited from Document
Picker
and is single selection.
The shared implementation also supports multiple selection when getMode() is overridden.
Required collection integration
The Core Group Picker deliberately does not hard-code a concrete group collection. Its getCollection()
returns null, so the application or context must override this method to return a
Core\Collection\User\GroupCollection\Base
implementation.
protected function getCollection(): BaseGroupCollection|null
{
// Return the concrete group collection of your application/context.
return $this->_groupCollection;
}
The example assumes $_groupCollection has already been supplied by the application. It
is
not a built-in property of the base Group Picker.
Opening the Group Picker from JavaScript
Because the Group Picker reuses the Document Picker frontend controller, it uses the same callback API. The callback receives selected group fields and an ID, not an automatically serialized full group document.
coreAppPickerDocumentPicker.pick('group-picker', (group) => {
console.log(group.id, group.name, group.active);
});
The application decides where to show the picker and how to use the selected group. Multiple
instances
require unique IDs through getId().
Group Picker override methods
| Override method | Purpose |
|---|---|
getId(): string |
Default is group-picker; override for multiple independent instances. |
getCollection(): BaseGroupCollection|null |
Required: supply the concrete group collection. |
getFields(): array |
Default columns: group name and active state. |
getSearchFields(): string|array|null |
Default text search by name. |
getSortFields(): array|null |
Default sorting by group name. |
addTranslations(): void |
Registers shared Document Picker and group-specific translations. |
All additional Document Picker extension points remain available, including getMode(),
exclusion IDs, template replacement, asset registration and search configuration.
Inherited lazy loading and pagination
Only the initial picker container is rendered with the page. Group results are retrieved when the picker is used, and search or page changes are handled through the shared AJAX search endpoint. This is especially valuable when multiple group selectors are embedded in an administration interface.
Bootstrap templates and multilingual support
The Group Picker reuses the replaceable templates and Bootstrap-versioned presentation of Document Picker. It also registers group-specific translations on top of the shared picker translations. APPNETOS Core Apps that require translations are available in 81 languages.