Tagpicker with select all values

Hi,

Can Tagpicker have select all values option without using lookup screen.
Currently we can search and select single values only.

image

Hello,

You need to create a custom action to select all items.

For example:

Controller:

    @Autowired
    private TagPicker<User> userTagPicker;
    @Autowired
    private CollectionContainer<User> usersDc;

    @Subscribe("userTagPicker.selectAllAction")
    public void onSelectAllAction(final Action.ActionPerformedEvent event) {
        List<User> items = usersDc.getItems();
        userTagPicker.setValue(items);
    }

Descriptor:

        <tagPicker id="userTagPicker" optionsContainer="usersDc">
            <actions>
                <action id="selectAllAction" caption="All" icon="LIST"/>
                <action id="value_clear" type="value_clear"/>
            </actions>
        </tagPicker>

UI component:
image

Regards,
Nikita

1 Like

Thank you