コード例 #1
0
  public void onSuccess(UserModel user) {
    deck.showWidget(1);

    if (!GwtClientUtils.preSuccessCheck(user, null)) {
      return;
    }

    // user exist - then fill all user information form and display information.
    if (user.getUid() != null && user.getUid() > 0) {
      fillPanel(user);
      form1.fillFields(user);
      form2.fillFields(user);
      form3.fillFields(user);
      editDeck.showWidget(0);
    }
    // image loading and center
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              public void execute() {
                ProfileDialog.this.center();
              }
            });
    // TODO: user not exist, error message display
  }
コード例 #2
0
  public void onSuccess(UserListModel model) {

    if (!GwtClientUtils.preSuccessCheck(model, null)) {
      // just simple display message on panel
      msgLabel.clear();
      msgLabel.add(ErrorCode.getMessage(model.errorCode, model.errorCode));
      return;
    }
    // show all users in this space group in table;
    fillPanel(model.getUserModelList());
  }
コード例 #3
0
ファイル: TagPopup.java プロジェクト: GeniusWiki/GeniusWiki
  public void onSuccess(PageItemListModel model) {
    if (!GwtClientUtils.preSuccessCheck(model, message)) {
      return;
    }

    pagesPanel.clear();
    for (PageItemModel item : model.itemList) {
      Hyperlink link =
          new Hyperlink(item.title, GwtUtils.getSpacePageToken(item.spaceUname, item.title));
      link.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              TagPopup.this.hide();
            }
          });
      pagesPanel.add(link);
    }

    resized();
  }
コード例 #4
0
  /**
   * @param model
   * @param content
   */
  private void callback(PortletModel model, RenderMarkupModel content) {
    busy(false);
    messagePanel.clear();
    clearControl();

    if (!GwtClientUtils.preSuccessCheck(model, null)) {
      // show error message on item part rather than general error message on HTML page above
      messagePanel.add(ErrorCode.getMessage(model.errorCode, model.errorMsg));
      return;
    }
    if (content.renderContent == null || content.renderContent.size() == 0) {
      contentPanel.clear();
      Label none = new Label("(" + Msg.consts.none() + ")");
      none.setStyleName(Css.PORTLET_WEAK_TEXT);
      contentPanel.add(none);
      contentPanel.submit();
    } else {
      PageRender render = new PageRender(contentPanel);
      render.renderContent(null, null, content.renderContent, false);

      controlBar.setPaginationInfo(model.hasPre, model.hasNxt, model.currentPage);
      addControl(controlBar);
    }
  }