コード例 #1
0
  @Override
  public void onClick(ClickEvent event) {
    super.onClick(event);

    OdkTablesAddNewTablePopup popup = new OdkTablesAddNewTablePopup();
    popup.setPopupPositionAndShow(popup.getPositionCallBack());
  }
コード例 #2
0
  @Override
  public void onClick(ClickEvent event) {
    super.onClick(event);

    PasswordTextBox password1 = popup.getPassword1();
    PasswordTextBox password2 = popup.getPassword2();
    UserSecurityInfo userInfo = popup.getUser();
    RealmSecurityInfo realmInfo = AggregateUI.getUI().getRealmInfo();

    String pw1 = password1.getText();
    String pw2 = password2.getText();
    if (pw1 == null || pw2 == null || pw1.length() == 0) {
      Window.alert("Password cannot be blank");
    } else if (pw1.equals(pw2)) {
      if (realmInfo == null || userInfo == null) {
        Window.alert("Unable to obtain required information from server");
      } else {
        CredentialsInfo credential;
        try {
          credential = CredentialsInfoBuilder.build(userInfo.getUsername(), realmInfo, pw1);
        } catch (NoSuchAlgorithmException e) {
          Window.alert("Unable to build credentials hash");
          return;
        }

        baseUrl = realmInfo.getChangeUserPasswordURL();

        // Construct a JSOP request
        String parameters = credential.getRequestParameters();
        String url = baseUrl + "?" + parameters + "&callback=";
        getJson(jsonRequestId++, url, this);
      }
    } else {
      Window.alert("The passwords do not match. Please retype the password.");
    }
  }