Search in sources :

Example 1 with VisitGrid

use of de.symeda.sormas.ui.visit.VisitGrid in project SORMAS-Project by hzi-braunschweig.

the class ContactVisitsView method initView.

// private void updateActiveStatusButtonCaption() {
// if (activeStatusButton != null) {
// activeStatusButton.setCaption(statusButtons.get(activeStatusButton) + LayoutUtil.spanCss(CssStyles.BADGE, String.valueOf(grid.getContainer().size())));
// }
// }
// private void processStatusChangeVisuals(Button button) {
// statusButtons.keySet().forEach(b -> {
// CssStyles.style(b, CssStyles.BUTTON_FILTER_LIGHT);
// b.setCaption(statusButtons.get(b));
// });
// CssStyles.removeStyles(button, CssStyles.BUTTON_FILTER_LIGHT);
// activeStatusButton = button;
// updateActiveStatusButtonCaption();
// }
@Override
protected void initView(String params) {
    // Hide the "New visit" button for converted contacts
    if (newButton != null && FacadeProvider.getContactFacade().getByUuid(getContactRef().getUuid()).getContactStatus() == ContactStatus.CONVERTED) {
        newButton.setVisible(false);
    }
    criteria.contact(getContactRef());
    if (grid == null) {
        grid = new VisitGrid(criteria);
        gridLayout = new DetailSubComponentWrapper(() -> null);
        gridLayout.setSizeFull();
        gridLayout.setMargin(true);
        gridLayout.setSpacing(false);
        gridLayout.addComponent(createTopBar());
        gridLayout.addComponent(grid);
        gridLayout.setExpandRatio(grid, 1);
        setSubComponent(gridLayout);
    }
    grid.reload();
    // updateActiveStatusButtonCaption();
    setContactEditPermission(gridLayout);
}
Also used : DetailSubComponentWrapper(de.symeda.sormas.ui.utils.DetailSubComponentWrapper) VisitGrid(de.symeda.sormas.ui.visit.VisitGrid)

Example 2 with VisitGrid

use of de.symeda.sormas.ui.visit.VisitGrid in project SORMAS-Project by hzi-braunschweig.

the class CaseVisitsView method initView.

@Override
protected void initView(String params) {
    criteria.caze(getCaseRef());
    if (grid == null) {
        grid = new VisitGrid(criteria);
        gridLayout = new DetailSubComponentWrapper(() -> null);
        gridLayout.setSizeFull();
        gridLayout.setMargin(true);
        gridLayout.setSpacing(false);
        gridLayout.addComponent(createTopBar());
        gridLayout.addComponent(grid);
        gridLayout.setExpandRatio(grid, 1);
        setSubComponent(gridLayout);
    }
    grid.reload();
    setCaseEditPermission(gridLayout);
}
Also used : DetailSubComponentWrapper(de.symeda.sormas.ui.utils.DetailSubComponentWrapper) VisitGrid(de.symeda.sormas.ui.visit.VisitGrid)

Aggregations

DetailSubComponentWrapper (de.symeda.sormas.ui.utils.DetailSubComponentWrapper)2 VisitGrid (de.symeda.sormas.ui.visit.VisitGrid)2