private Component buildFooter() {
    HorizontalLayout footer = new HorizontalLayout();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth(100.0f, Unit.PERCENTAGE);

    Button ok = new Button("OK");
    ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
    ok.addClickListener(
        event -> {
          try {
            fieldGroup.commit();
            // Updated user should also be persisted to database. But
            // not in this demo.

            Notification success = new Notification("Profile updated successfully");
            success.setDelayMsec(2000);
            success.setStyleName("bar success small");
            success.setPosition(Position.BOTTOM_CENTER);
            success.show(Page.getCurrent());

            //                    DashboardEventBus.post(new ProfileUpdatedEvent());
            close();
          } catch (CommitException e) {
            Notification.show("Error while updating profile", Type.ERROR_MESSAGE);
          }
        });
    ok.focus();
    footer.addComponent(ok);
    footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
    return footer;
  }