public int doStartTag() throws JspException {
    try {
      purchaseRequisitionMgr =
          (PurchaseRequisitionMgr) pageContext.getSession().getAttribute("purchaseRequisitionMgr");

      iterator = purchaseRequisitionMgr.getCurrentPurchaseRequest().getPrDetailList().iterator();
      if (purchaseRequisitionMgr.getCurrentPurchaseRequest().getPrDetailList().size() == 0) {
        return Tag.SKIP_BODY;
      }
      if (!iterator.hasNext()) {
        return Tag.SKIP_BODY;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return IterationTag.EVAL_BODY_AGAIN;
  }
Exemplo n.º 2
0
  public int doStartTag() throws JspException {
    try {
      purchaseRequisitionMgr =
          (PurchaseRequisitionMgr) pageContext.getSession().getAttribute("purchaseRequisitionMgr");

      PurchaseRequest purchaseRequest = purchaseRequisitionMgr.getCurrentPurchaseRequest();

      pageContext.setAttribute(
          "prId", purchaseRequest.getPrId() == null ? "" : purchaseRequest.getPrId());
      pageContext.setAttribute(
          "creationDate",
          purchaseRequest.getCreationDate() == null ? "" : purchaseRequest.getCreationDate());
      pageContext.setAttribute(
          "createdBy",
          purchaseRequest.getCreatedBy() == null ? "" : purchaseRequest.getCreatedBy());
      pageContext.setAttribute("isSaved", purchaseRequest.isIsSaved() ? "Y" : "N");
      pageContext.setAttribute("isSend", purchaseRequest.isIsSend() ? "Y" : "N");
      pageContext.setAttribute("isClamant", purchaseRequest.isIsClamant() ? "Y" : "N");
      pageContext.setAttribute("statusString", purchaseRequest.getStatusString());
      pageContext.setAttribute(
          "prStatus", purchaseRequest.getPrStatus() == null ? "" : purchaseRequest.getPrStatus());
      pageContext.setAttribute("modifiedReason", purchaseRequest.getModifiedReason());

      pageContext.setAttribute(
          "modifiedReasonError",
          purchaseRequest.isValid("modifiedReason")
              ? ""
              : purchaseRequest.getMessage("modifiedReason"));
      pageContext.setAttribute(
          "prError", purchaseRequest.hasMessage() ? purchaseRequest.getMessage() : "");

    } catch (Exception e) {
      e.printStackTrace();
    }
    return Tag.EVAL_BODY_INCLUDE;
  }