Example #1
0
  @AutoGenerated
  private VerticalLayout buildSecurityLayout() {
    // common part: create layout
    securityLayout = new VerticalLayout();
    securityLayout.setImmediate(false);
    securityLayout.setWidth("100.0%");
    securityLayout.setHeight("100.0%");
    securityLayout.setMargin(false);

    // userField
    userField = new UserField();
    userField.setImmediate(false);
    userField.setWidth("100.0%");
    userField.setHeight("100.0%");
    securityLayout.addComponent(userField);
    securityLayout.setExpandRatio(userField, 1.0f);

    return securityLayout;
  }
Example #2
0
  @Override
  public void attach() {
    super.attach();

    // recover the parent entity (Client) from parent view window (ClientViewForm)
    if (getParent().getWindow() instanceof WindowDialog<?>) {
      @SuppressWarnings("unchecked")
      WindowDialog<Client> clientWindowDialog = (WindowDialog<Client>) getParent().getWindow();
      client = clientWindowDialog.getDomainEntity();

      userField.setAgent(client);
    }
  }