Search in sources :

Example 6 with Subscribe

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

the class ValidatorScreen method onAddValidBtn1Click.

// tag::decimal-max-validator[]
@Subscribe("addValidBtn1")
protected void onAddValidBtn1Click(Button.ClickEvent event) {
    DecimalMaxValidator maxValidator = applicationContext.getBean(DecimalMaxValidator.class, new BigDecimal(1000));
    numberField.addValidator(maxValidator);
}
Also used : BigDecimal(java.math.BigDecimal) Subscribe(io.jmix.ui.screen.Subscribe)

Example 7 with Subscribe

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

the class EventInfo method onSelectBtnClick.

// tag::select-btn[]
@Subscribe("selectBtn")
protected void onSelectBtnClick(Button.ClickEvent e) {
    // <1>
    Event event = eventField.getValue();
    if (event == null) {
        // <2>
        urlRouting.replaceState(this);
        return;
    }
    // <3>
    String serializedEventId = UrlIdSerializer.serializeId(event.getId());
    // <4>
    urlRouting.replaceState(this, ImmutableMap.of("event_id", serializedEventId));
}
Also used : Event(ui.ex1.entity.Event) UrlParamsChangedEvent(io.jmix.ui.navigation.UrlParamsChangedEvent) Subscribe(io.jmix.ui.screen.Subscribe)

Example 8 with Subscribe

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

the class HostScreen method onInit.

@Subscribe
private void onInit(InitEvent event) {
    // <2>
    AddressFragment addressFragment = fragments.create(this, AddressFragment.class);
    // <3>
    addressBox.add(addressFragment.getFragment());
}
Also used : AddressFragment(ui.ex1.screen.screens.fragments.AddressFragment) Subscribe(io.jmix.ui.screen.Subscribe)

Example 9 with Subscribe

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

the class HasBanner method initBanner.

@Subscribe
default void initBanner(Screen.InitEvent event) {
    // <1>
    ApplicationContext applicationContext = Extensions.getApplicationContext(event.getSource());
    // <2>
    UiComponents uiComponents = applicationContext.getBean(UiComponents.class);
    // <3>
    Label<String> banner = uiComponents.create(Label.TYPE_STRING);
    banner.setStyleName(ThemeClassNames.LABEL_H2);
    banner.setValue("Hello, world!");
    // <4>
    event.getSource().getWindow().add(banner, 0);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) UiComponents(io.jmix.ui.UiComponents) Subscribe(io.jmix.ui.screen.Subscribe)

Example 10 with Subscribe

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

the class HostScreen2 method onInit.

@Subscribe
private void onInit(InitEvent event) {
    AddressFragment addressFragment = fragments.create(this, AddressFragment.class);
    // <1>
    addressFragment.setStringParam("Value");
    addressBox.add(addressFragment.getFragment());
}
Also used : AddressFragment(ui.ex1.screen.screens.fragments.AddressFragment) 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