예제 #1
0
  /** @param AssesmentProxy assesment */
  private void init(QuestionProxy question) {

    this.question = question;
    Log.debug("Details für: " + question.getQuestionText());
    view.setValue(question);

    initAnswerView();
  }
예제 #2
0
  @Override
  public void start2(AcceptsOneWidget panel, EventBus eventBus) {

    questionDetailsView = new QuestionDetailsViewImpl();
    questionDetailsView.setName("hallo");
    questionDetailsView.setPresenter(this);
    this.widget = panel;
    this.view = questionDetailsView;
    widget.setWidget(questionDetailsView.asWidget());
    // setTable(view.getTable());

    eventBus.addHandler(
        PlaceChangeEvent.TYPE,
        new PlaceChangeEvent.Handler() {
          public void onPlaceChange(PlaceChangeEvent event) {
            // updateSelection(event.getNewPlace());
            // TODO implement
          }
        });
    // init();

    view.setDelegate(this);

    this.answerListView = view.getAnswerListViewImpl();
    answerListView.setDelegate(this);
    this.answerTable = answerListView.getTable();

    requests
        .personRequestNonRoo()
        .myGetLoggedPerson()
        .fire(
            new Receiver<PersonProxy>() {

              @Override
              public void onSuccess(PersonProxy response) {
                loggedUser = response;
                start2();
              }

              public void onFailure(ServerFailure error) {
                ErrorPanel erorPanel = new ErrorPanel();
                erorPanel.setErrorMessage(error.getMessage());
                Log.error(error.getMessage());
                onStop();
              }

              @Override
              public void onViolation(Set<Violation> errors) {
                Iterator<Violation> iter = errors.iterator();
                String message = "";
                while (iter.hasNext()) {
                  message += iter.next().getMessage() + "<br>";
                }
                Log.warn(
                    McAppConstant.ERROR_WHILE_DELETE_VIOLATION + " in Antwort löschen -" + message);

                ErrorPanel erorPanel = new ErrorPanel();
                erorPanel.setErrorMessage(message);
                onStop();
              }
            });
  }