Ejemplo n.º 1
0
  private void initAnswerView() {

    if (answerRangeChangeHandler != null) {
      answerRangeChangeHandler.removeHandler();
      answerRangeChangeHandler = null;
    }

    requests
        .answerRequestNonRoo()
        .contAnswersByQuestion(question.getId())
        .fire(
            new Receiver<Long>() {

              @Override
              public void onSuccess(Long response) {

                answerTable.setRowCount(response.intValue(), true);

                onAnswerTableRangeChanged();
              }

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

              @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 hinzufügen -"
                        + message);

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

    answerRangeChangeHandler =
        answerTable.addRangeChangeHandler(
            new RangeChangeEvent.Handler() {
              public void onRangeChange(RangeChangeEvent event) {
                ActivityQuestionDetails.this.onAnswerTableRangeChanged();
              }
            });
  }
Ejemplo n.º 2
0
 public PhotoView() {
   initWidget(uiBinder.createAndBindUi(this));
   cellTable.setWidth("100%", true);
   pager.setDisplay(cellTable);
   initColumns();
   cellTable.addRangeChangeHandler(
       new RangeChangeEvent.Handler() {
         @Override
         public void onRangeChange(RangeChangeEvent event) {
           AppContext.getInstance()
               .getEventBus()
               .fireEvent(new ShowPhotoRange(event.getNewRange()));
         }
       });
 }