private void loadResponses() {
    statusLabel.setText(TEXT_CONSTANTS.pleaseWait());
    statusLabel.setVisible(true);

    surveyInstanceSvc.listResponsesByQuestion(
        questionId,
        getCursor(currentPage - 1),
        new AsyncCallback<ResponseDto<ArrayList<QuestionAnswerStoreDto>>>() {
          @Override
          public void onFailure(Throwable caught) {
            MessageDialog errDia =
                new MessageDialog(
                    TEXT_CONSTANTS.error(),
                    TEXT_CONSTANTS.errorTracePrefix() + " " + caught.getLocalizedMessage());
            errDia.showCentered();
          }

          @Override
          public void onSuccess(ResponseDto<ArrayList<QuestionAnswerStoreDto>> result) {
            currentAnswers = result.getPayload();
            setCursor(result.getCursorString());
            populateData(result.getPayload());
          }
        });
  }
  @Override
  public void onClick(final ClickEvent event) {
    if (event.getSource() == nextButton) {
      currentPage++;
      loadResponses();
    } else if (event.getSource() == previousButton) {
      currentPage--;
      loadResponses();
    } else if (event.getSource() == clearButton) {
      populateData(currentAnswers);
    } else if (event.getSource() == saveButton) {
      if (changedAnswers != null && changedAnswers.size() > 0) {
        statusLabel.setText(TEXT_CONSTANTS.pleaseWait());
        statusLabel.setVisible(true);
        surveyInstanceSvc.updateQuestions(
            new ArrayList<QuestionAnswerStoreDto>(changedAnswers.values()),
            true,
            new AsyncCallback<List<QuestionAnswerStoreDto>>() {

              @Override
              public void onFailure(Throwable caught) {
                MessageDialog errDia =
                    new MessageDialog(
                        TEXT_CONSTANTS.error(),
                        TEXT_CONSTANTS.errorTracePrefix() + " " + caught.getLocalizedMessage());
                errDia.showCentered();
                statusLabel.setVisible(false);
              }

              @Override
              public void onSuccess(List<QuestionAnswerStoreDto> result) {
                statusLabel.setVisible(false);
                if (result != null) {
                  // update the value in the
                  // questionsList so we can
                  // keep the data consistent
                  // if the user presses clear
                  for (QuestionAnswerStoreDto dto : result) {
                    for (int i = 0; i < currentAnswers.size(); i++) {
                      if (currentAnswers.get(i).getKeyId().equals(dto.getKeyId())) {
                        currentAnswers.get(i).setValue(dto.getValue());
                      }
                    }
                  }
                }
                populateData(currentAnswers);
              }
            });
      }
    } else if (event.getSource() == doneButton) {
      dismissDialog();
    }
  }