Search in sources :

Example 1 with ItemsSelectedEvent

use of io.jmix.dashboardsui.event.ItemsSelectedEvent in project jmix by jmix-framework.

the class DashboardImpl method assignItemSelectedHandler.

private void assignItemSelectedHandler(LookupWidget widget) {
    ListComponent lookupComponent = widget.getLookupComponent();
    DataUnit items = lookupComponent.getItems();
    if (items != null) {
        items.addStateChangeListener(e -> {
            uiEventPublisher.publishEvent(new ItemsSelectedEvent((Widget) widget, lookupComponent.getSelected()));
        });
    }
}
Also used : ItemsSelectedEvent(io.jmix.dashboardsui.event.ItemsSelectedEvent) DataUnit(io.jmix.ui.component.data.DataUnit) LookupWidget(io.jmix.dashboardsui.widget.LookupWidget) Widget(io.jmix.dashboards.model.Widget) RefreshableWidget(io.jmix.dashboardsui.widget.RefreshableWidget)

Aggregations

Widget (io.jmix.dashboards.model.Widget)1 ItemsSelectedEvent (io.jmix.dashboardsui.event.ItemsSelectedEvent)1 LookupWidget (io.jmix.dashboardsui.widget.LookupWidget)1 RefreshableWidget (io.jmix.dashboardsui.widget.RefreshableWidget)1 DataUnit (io.jmix.ui.component.data.DataUnit)1