Search in sources :

Example 41 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix by jmix-framework.

the class DetailsStepFragment method onEntityValueChange.

@Subscribe("entityField")
public void onEntityValueChange(HasValue.ValueChangeEvent<MetaClass> event) {
    ReportData reportData = reportDataDc.getItem();
    updateReportEntity(event.getPrevValue(), event.getValue(), reportData);
}
Also used : ReportData(io.jmix.reports.entity.wizard.ReportData) Subscribe(io.jmix.ui.screen.Subscribe)

Example 42 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix by jmix-framework.

the class MenuResourcePolicyModelCreate method onMenuFieldValueChange.

@Subscribe("menuItemField")
public void onMenuFieldValueChange(HasValue.ValueChangeEvent<String> event) {
    String menuItemId = event.getValue();
    policyGroupField.setValue(resourcePolicyGroupResolver.resolvePolicyGroup(ResourcePolicyType.MENU, menuItemId));
    screenId = null;
    if (menuItemId != null) {
        MenuItem menuItem = resourcePolicyEditorUtils.findMenuItemById(menuItemId);
        if (menuItem != null) {
            screenId = menuItem.getScreen();
        }
    }
    if (screenId == null) {
        screenField.setValue(null);
        screenAccessField.setValue(Boolean.FALSE);
        screenAccessField.setEditable(false);
    } else {
        screenField.setValue(resourcePolicyEditorUtils.getScreenCaption(screenId));
        screenAccessField.setEditable(true);
    }
}
Also used : MenuItem(io.jmix.ui.menu.MenuItem) Subscribe(io.jmix.ui.screen.Subscribe)

Example 43 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix by jmix-framework.

the class OrderScreen method onBeforeShow.

@Subscribe
protected void onBeforeShow(BeforeShowEvent event) {
    Order mergedOrder = dataContext.merge(order);
    orderDc.setItem(mergedOrder);
}
Also used : Order(test_support.entity.sales.Order) Subscribe(io.jmix.ui.screen.Subscribe)

Example 44 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix by jmix-framework.

the class TimeFieldDatatypeTestScreen method onInit.

@Subscribe
protected void onInit(InitEvent event) {
    Date now = new Date();
    timeField.setValue(new Time(now.getTime()));
    localTimeField.setValue(LocalTime.now());
    offsetTimeField.setValue(OffsetTime.now());
}
Also used : OffsetTime(java.time.OffsetTime) Time(java.sql.Time) LocalTime(java.time.LocalTime) Date(java.util.Date) Subscribe(io.jmix.ui.screen.Subscribe)

Example 45 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix by jmix-framework.

the class MultiSelectListTestScreen method onInit.

@Subscribe
private void onInit(InitEvent event) {
    Order order = metadata.create(Order.class);
    orderDc.setItem(order);
    List<OrderLine> orderLines = IntStream.range(0, 5).mapToObj(i -> metadata.create(OrderLine.class)).collect(Collectors.toList());
    allOrderLinesDc.getMutableItems().addAll(orderLines);
    OrderLine orderLine = metadata.create(OrderLine.class);
    orderLineDc.setItem(orderLine);
    List<Product> products = IntStream.range(0, 5).mapToObj(i -> metadata.create(Product.class)).collect(Collectors.toList());
    allProductsDc.getMutableItems().addAll(products);
    CatalogObject catalog = metadata.create(CatalogObject.class);
    catalogDc.setItem(catalog);
}
Also used : Order(test_support.entity.sales.Order) IntStream(java.util.stream.IntStream) Subscribe(io.jmix.ui.screen.Subscribe) CollectionContainer(io.jmix.ui.model.CollectionContainer) UiController(io.jmix.ui.screen.UiController) Autowired(org.springframework.beans.factory.annotation.Autowired) Metadata(io.jmix.core.Metadata) Screen(io.jmix.ui.screen.Screen) Order(test_support.entity.sales.Order) OrderLine(test_support.entity.sales.OrderLine) Collectors(java.util.stream.Collectors) UiDescriptor(io.jmix.ui.screen.UiDescriptor) List(java.util.List) MultiSelectList(io.jmix.ui.component.MultiSelectList) InstanceContainer(io.jmix.ui.model.InstanceContainer) InstancePropertyContainer(io.jmix.ui.model.InstancePropertyContainer) Product(test_support.entity.sales.Product) CatalogObject(test_support.entity.model_objects.CatalogObject) OrderLine(test_support.entity.sales.OrderLine) Product(test_support.entity.sales.Product) CatalogObject(test_support.entity.model_objects.CatalogObject) Subscribe(io.jmix.ui.screen.Subscribe)

Aggregations

Subscribe (io.jmix.ui.screen.Subscribe)79 Report (io.jmix.reports.entity.Report)8 Screen (io.jmix.ui.screen.Screen)8 ListDataProvider (io.jmix.ui.data.impl.ListDataProvider)5 UiController (io.jmix.ui.screen.UiController)5 UiDescriptor (io.jmix.ui.screen.UiDescriptor)5 UUID (java.util.UUID)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 ReportOutputDocument (com.haulmont.yarg.reporting.ReportOutputDocument)4 FileRef (io.jmix.core.FileRef)4 BigDecimal (java.math.BigDecimal)4 Date (java.util.Date)4 List (java.util.List)4 Order (test_support.entity.sales.Order)4 Metadata (io.jmix.core.Metadata)3 Visit (io.jmix.petclinic.entity.visit.Visit)3 UiReportRunContext (io.jmix.reportsui.runner.UiReportRunContext)3 FilterCondition (io.jmix.ui.entity.FilterCondition)3 GroupFilterCondition (io.jmix.ui.entity.GroupFilterCondition)3 LogicalFilterCondition (io.jmix.ui.entity.LogicalFilterCondition)3