IDs of components in composite component are not contained

If you have e.g. a label with id “currency” inside a composite component and you use this component elsewhere where you have another component e.g. a LookupPicker with id “currency” injecting the component in the controller won’t work or adding a listener like…

    @Subscribe("currency")
    public void onCurrencyValueChange(HasValue.ValueChangeEvent<Currency> event) {
...

would also not work.

Hi,

This is known limitation. Component Ids of CompositeComponent layout must have unique values, so it’s better to add some prefix, e.g. myCompositeComponent_currency. I’ll created a GitHub issue on documentation to mention that.

Regards,
Gleb

1 Like