Search in sources :

Example 1 with Subscribe

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();
}
Also used : Screen(io.jmix.ui.screen.Screen) Visit(io.jmix.petclinic.entity.visit.Visit) Subscribe(io.jmix.ui.screen.Subscribe)

Example 2 with Subscribe

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();
}
Also used : Screen(io.jmix.ui.screen.Screen) Subscribe(io.jmix.ui.screen.Subscribe)

Example 3 with Subscribe

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());
    }
}
Also used : Visit(io.jmix.petclinic.entity.visit.Visit) Subscribe(io.jmix.ui.screen.Subscribe)

Example 4 with Subscribe

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());
    }
}
Also used : Visit(io.jmix.petclinic.entity.visit.Visit) Subscribe(io.jmix.ui.screen.Subscribe)

Example 5 with Subscribe

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);
}
Also used : BigDecimal(java.math.BigDecimal) 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