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);
}
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);
}
}
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);
}
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());
}
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);
}
Aggregations