/**
   * Checks that at least one object code is selected and stores the selection settings. If no
   * object code is selected, an error message is displayed to the user.
   *
   * @param objectCodePickList - List of BudgetConstructionObjectPick objects to check
   * @return boolean - true if there was a selection and the list was saved, otherwise false
   */
  protected boolean storedSelectedObjectCodes(
      List<BudgetConstructionObjectPick> objectCodePickList) {
    boolean foundSelected = false;

    // check to see if at least one pullflag is set and store the selectFlag settings for currently
    // displayed set of object
    // codes
    for (BudgetConstructionObjectPick budgetConstructionObjectPick : objectCodePickList) {
      if (budgetConstructionObjectPick.getSelectFlag() > 0) {
        foundSelected = true;
      }
    }

    // if selection was found, save the object code selections, otherwise build error message
    if (foundSelected) {
      SpringContext.getBean(BudgetReportsControlListService.class)
          .updateObjectCodeSelectFlags(objectCodePickList);
    } else {
      GlobalVariables.getMessageMap()
          .putError(
              KFSConstants.GLOBAL_ERRORS, BCKeyConstants.ERROR_BUDGET_OBJECT_CODE_NOT_SELECTED);
    }

    return foundSelected;
  }
  /** unselects all object codes. */
  public ActionForward unselectAllObjectCodes(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    OrganizationReportSelectionForm organizationReportSelectionForm =
        (OrganizationReportSelectionForm) form;
    for (BudgetConstructionObjectPick budgetConstructionObjectPick :
        organizationReportSelectionForm.getObjectCodePickList()) {
      budgetConstructionObjectPick.setSelectFlag(new Integer(0));
    }

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
  }