How can i achieve single component on screen to multiply based on data from entity?
Let say i want to create icons in screen for each row of entity.
How can i achieve single component on screen to multiply based on data from entity?
Let say i want to create icons in screen for each row of entity.
You can achieve it by programmatic creation of ui, here is example:
@Inject
private VBoxLayout container;
@Inject
private UiComponents uiComponents;
@Subscribe(id = "clientsDl", target = Target.DATA_LOADER)
public void onClientsDlPostLoad(CollectionLoader.PostLoadEvent<Client> event) {
event.getLoadedEntities().forEach(client -> {
Label<String> iconLabel = uiComponents.create(Label.TYPE_STRING);
iconLabel.setIconFromSet(CubaIcon.STAR);
container.add(iconLabel);
});
}