Пример #1
0
  public void chklistEditSelEvent() {
    System.out.println("Inside chklistSelEvent");
    if (getSelectedChkList() == 0) {
      setDisplayTable(false);
      setCreateSelectFS(true);
      setVersionSelection(true);

    } else {
      setDisplayTable(true);
      setCreateSelectFS(false);
      setVersionSelection(false);
      for (AuditDataChecklist ck : getAllChecklists()) {
        if (ck.getPkCheckId().intValue() == getSelectedChkList()) {
          setSelCheckList(ck);
        }
      }
      setCurrentVersion(checklistService.getVersion(getSelCheckList()));
      List<Integer> tempQustCheckMaps = new ArrayList<Integer>();
      for (AuditDataQustCheckMap qcM : getSelCheckList().getAuditDataQustCheckMaps()) {
        tempQustCheckMaps.add(qcM.getPkQcMapId());
      }
      qlist = checklistService.getChklistQuestions(getCurrentVersion(), tempQustCheckMaps);
      setValidColKeys(chklstSelService.getDynamicColumns(selCheckList));
      for (String str : getValidColKeys()) {
        if (getColumnTemplate().length() <= 1) {
          columnTemplate = columnTemplate.concat(str);
        } else {
          columnTemplate = columnTemplate.concat("-").concat(str);
        }
      }
      System.out.println("Vcolumn Template" + columnTemplate);
      createDynamicColumns();
    }
  }
Пример #2
0
  @PostConstruct
  public void init() {
    LOGGER.info("Initializing");
    try {
      setLeadAuditorlist(getChecklistService().getAllLAs());
    } catch (AuditGeneralException e1) {
      LOGGER.error(e1.getMessage());
    }
    try {

      auditCheckId = (Integer) servletContext.getAttribute("auditId");
      selCheckList = getChklstSelService().getselectCheckList(auditCheckId);
      if (null != selCheckList) {

        setSelectedValue(selCheckList.getCheckName());
        setDisplayTable(true);
        qlist = getChklstSelService().getChklistQuestions(selCheckList.getPkCheckId());
        setValidColKeys(chklstSelService.getDynamicColumns(selCheckList));
        for (String str : getValidColKeys()) {
          if (getColumnTemplate().length() <= 1) {
            columnTemplate = columnTemplate.concat(str);
          } else {
            columnTemplate = columnTemplate.concat("-").concat(str);
          }
        }
        System.out.println("Vcolumn Template" + columnTemplate);
        createDynamicColumns();
        RequestContext.getCurrentInstance().update(":selChklstForm:tablePanel");
      } else {
        checklists = getChklstSelService().listBaselinedCheckLists();
        rejectedChecklists = getChklstSelService().getVersionedRejectedCheckLists();
        getAllChecklists().addAll(checklists);
        getAllChecklists().addAll(rejectedChecklists);
        setCreateSelectFS(true);
        setEditSelectFS(true);
      }
    } catch (Exception e) {
      LOGGER.error(e.getMessage());
    }
    LOGGER.info("Initialized");
  }