use of io.jmix.ui.screen.Subscribe in project jmix-sneferu by mariodavid.
the class VisitBrowse method onCalendarCalendarEventClick.
@Subscribe("calendar")
protected void onCalendarCalendarEventClick(Calendar.CalendarEventClickEvent<LocalDateTime> event) {
Screen visitEditor = screenBuilders.editor(Visit.class, this).editEntity((Visit) event.getEntity()).withOpenMode(OpenMode.DIALOG).build();
visitEditor.addAfterCloseListener(afterCloseEvent -> {
if (afterCloseEvent.closedWith(StandardOutcome.COMMIT)) {
getScreenData().loadAll();
}
});
visitEditor.show();
}
use of io.jmix.ui.screen.Subscribe in project jmix-sneferu by mariodavid.
the class VisitBrowse method onCalendarCalendarDayClick.
// ///////////////////////////////////////////////////////////////////////////////////////////////////////
// Calendar Visit Event Click
// ///////////////////////////////////////////////////////////////////////////////////////////////////////
@Subscribe("calendar")
protected void onCalendarCalendarDayClick(Calendar.CalendarDayClickEvent<LocalDateTime> event) {
Screen visitEditor = screenBuilders.editor(Visit.class, this).newEntity().withInitializer(visit -> {
visit.setVisitStart(event.getDate());
visit.setVisitEnd(event.getDate().plusHours(1));
}).withOpenMode(OpenMode.DIALOG).build();
visitEditor.addAfterCloseListener(afterCloseEvent -> {
if (afterCloseEvent.closedWith(StandardOutcome.COMMIT)) {
getScreenData().loadAll();
}
});
visitEditor.show();
}
use of io.jmix.ui.screen.Subscribe in project jmix-sneferu by mariodavid.
the class MyVisits method onStart.
@Subscribe("table.start")
protected void onStart(Action.ActionPerformedEvent event) {
final Visit visit = table.getSingleSelected();
if (visit.hasStarted()) {
petTreatmentWarningMessage("treatmentAlreadyStarted", visit.getPetName());
} else {
updateTreatmentTo(visit, VisitTreatmentStatus.IN_PROGRESS);
petTreatmentSuccessMessage("treatmentStarted", visit.getPetName());
}
}
use of io.jmix.ui.screen.Subscribe in project jmix-sneferu by mariodavid.
the class MyVisits method onTableFinish.
@Subscribe("table.finish")
protected void onTableFinish(Action.ActionPerformedEvent event) {
final Visit visit = table.getSingleSelected();
if (visit.hasFinished()) {
petTreatmentWarningMessage("treatmentAlreadyFinished", visit.getPetName());
} else {
updateTreatmentTo(visit, VisitTreatmentStatus.DONE);
petTreatmentSuccessMessage("treatmentFinished", visit.getPetName());
}
}
use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.
the class ValidatorScreen method onAddValidBtn2Click.
// tag::decimal-min-validator[]
@Subscribe("addValidBtn2")
protected void onAddValidBtn2Click(Button.ClickEvent event) {
DecimalMinValidator minValidator = applicationContext.getBean(DecimalMinValidator.class, new BigDecimal(100));
numberField2.addValidator(minValidator);
}
Aggregations