コード例 #1
0
  @Override
  public void showErrors(List<EditorError> errors) {
    if (errors != null && errors.size() > 0) {

      List<EditorError> casTbFieldErrors = new ArrayList<EditorError>();
      List<EditorError> dateFieldErrors = new ArrayList<EditorError>();
      List<EditorError> raisonDepistageFieldErrors = new ArrayList<EditorError>();
      List<EditorError> resultatFieldErrors = new ArrayList<EditorError>();

      for (EditorError error : errors) {
        Object userData = error.getUserData();
        if (userData != null && userData instanceof String) {
          String field = (String) userData;

          if (field.equals("casTb")) casTbFieldErrors.add(error);
          if (field.equals("date")) dateFieldErrors.add(error);
          if (field.equals("raisonDepistage")) raisonDepistageFieldErrors.add(error);
          if (field.equals("resultat")) resultatFieldErrors.add(error);
        }
      }
      if (casTbFieldErrors.size() > 0) casTb.showErrors(casTbFieldErrors);
      if (dateFieldErrors.size() > 0) date.showErrors(dateFieldErrors);
      if (raisonDepistageFieldErrors.size() > 0)
        raisonDepistage.showErrors(raisonDepistageFieldErrors);
      if (resultatFieldErrors.size() > 0) resultat.showErrors(resultatFieldErrors);
    }
  }