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