Search in sources :

Example 1 with Order

use of com.haulmont.cuba.web.testmodel.sales.Order in project cuba by cuba-platform.

the class OptionsGroupTestScreen 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);
    Catalog catalog = metadata.create(Catalog.class);
    catalogDc.setItem(catalog);
}
Also used : Order(com.haulmont.cuba.web.testmodel.sales.Order) IntStream(java.util.stream.IntStream) OptionsGroup(com.haulmont.cuba.gui.components.OptionsGroup) InstancePropertyContainer(com.haulmont.cuba.gui.model.InstancePropertyContainer) Catalog(com.haulmont.cuba.web.testmodel.sales.Catalog) Set(java.util.Set) Screen(com.haulmont.cuba.gui.screen.Screen) UiController(com.haulmont.cuba.gui.screen.UiController) InstanceContainer(com.haulmont.cuba.gui.model.InstanceContainer) Subscribe(com.haulmont.cuba.gui.screen.Subscribe) Product(com.haulmont.cuba.web.testmodel.sales.Product) Collectors(java.util.stream.Collectors) Metadata(com.haulmont.cuba.core.global.Metadata) Inject(javax.inject.Inject) List(java.util.List) UiDescriptor(com.haulmont.cuba.gui.screen.UiDescriptor) OrderLine(com.haulmont.cuba.web.testmodel.sales.OrderLine) CollectionContainer(com.haulmont.cuba.gui.model.CollectionContainer) Order(com.haulmont.cuba.web.testmodel.sales.Order) OrderLine(com.haulmont.cuba.web.testmodel.sales.OrderLine) Product(com.haulmont.cuba.web.testmodel.sales.Product) Catalog(com.haulmont.cuba.web.testmodel.sales.Catalog) Subscribe(com.haulmont.cuba.gui.screen.Subscribe)

Example 2 with Order

use of com.haulmont.cuba.web.testmodel.sales.Order in project cuba by cuba-platform.

the class OptionsListTestScreen 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);
    Catalog catalog = metadata.create(Catalog.class);
    catalogDc.setItem(catalog);
}
Also used : Order(com.haulmont.cuba.web.testmodel.sales.Order) IntStream(java.util.stream.IntStream) InstancePropertyContainer(com.haulmont.cuba.gui.model.InstancePropertyContainer) Catalog(com.haulmont.cuba.web.testmodel.sales.Catalog) Set(java.util.Set) Screen(com.haulmont.cuba.gui.screen.Screen) UiController(com.haulmont.cuba.gui.screen.UiController) InstanceContainer(com.haulmont.cuba.gui.model.InstanceContainer) Subscribe(com.haulmont.cuba.gui.screen.Subscribe) Product(com.haulmont.cuba.web.testmodel.sales.Product) Collectors(java.util.stream.Collectors) Metadata(com.haulmont.cuba.core.global.Metadata) Inject(javax.inject.Inject) List(java.util.List) OptionsList(com.haulmont.cuba.gui.components.OptionsList) UiDescriptor(com.haulmont.cuba.gui.screen.UiDescriptor) OrderLine(com.haulmont.cuba.web.testmodel.sales.OrderLine) CollectionContainer(com.haulmont.cuba.gui.model.CollectionContainer) Order(com.haulmont.cuba.web.testmodel.sales.Order) OrderLine(com.haulmont.cuba.web.testmodel.sales.OrderLine) Product(com.haulmont.cuba.web.testmodel.sales.Product) Catalog(com.haulmont.cuba.web.testmodel.sales.Catalog) Subscribe(com.haulmont.cuba.gui.screen.Subscribe)

Example 3 with Order

use of com.haulmont.cuba.web.testmodel.sales.Order in project cuba by cuba-platform.

the class OrderScreen method onBeforeShow.

@Subscribe
protected void onBeforeShow(BeforeShowEvent event) {
    Order mergedOrder = dataContext.merge(order);
    orderDc.setItem(mergedOrder);
}
Also used : Order(com.haulmont.cuba.web.testmodel.sales.Order) Subscribe(com.haulmont.cuba.gui.screen.Subscribe)

Aggregations

Subscribe (com.haulmont.cuba.gui.screen.Subscribe)3 Order (com.haulmont.cuba.web.testmodel.sales.Order)3 Metadata (com.haulmont.cuba.core.global.Metadata)2 CollectionContainer (com.haulmont.cuba.gui.model.CollectionContainer)2 InstanceContainer (com.haulmont.cuba.gui.model.InstanceContainer)2 InstancePropertyContainer (com.haulmont.cuba.gui.model.InstancePropertyContainer)2 Screen (com.haulmont.cuba.gui.screen.Screen)2 UiController (com.haulmont.cuba.gui.screen.UiController)2 UiDescriptor (com.haulmont.cuba.gui.screen.UiDescriptor)2 Catalog (com.haulmont.cuba.web.testmodel.sales.Catalog)2 OrderLine (com.haulmont.cuba.web.testmodel.sales.OrderLine)2 Product (com.haulmont.cuba.web.testmodel.sales.Product)2 List (java.util.List)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 IntStream (java.util.stream.IntStream)2 Inject (javax.inject.Inject)2 OptionsGroup (com.haulmont.cuba.gui.components.OptionsGroup)1 OptionsList (com.haulmont.cuba.gui.components.OptionsList)1