Пример #1
0
 public List getList() {
   List list1 = new ArrayList();
   DCBindingContainer bc = (DCBindingContainer) getBindings();
   DCIteratorBinding ir = (DCIteratorBinding) bc.findIteratorBinding("DayWeekVO1Iterator");
   Row row = ir.getCurrentRow();
   if (row != null) {
     Iterator itr = daysOfWeek.iterator();
     while (itr.hasNext()) {
       String day = (String) itr.next();
       if ("Y".equalsIgnoreCase((String) row.getAttribute(day))) list1.add(day);
     }
   }
   return list1;
 }
Пример #2
0
 public String getDel_style() {
   DCBindingContainer bd =
       (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
   DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
   Row currRow = it.getCurrentRow();
   Integer Del = (Integer) currRow.getAttribute("Deleted");
   String RetStr = null;
   if (Del == 0) {
     RetStr = "font-size:large; Color : Red;";
   } else {
     RetStr = "font-size:large;";
   }
   return RetStr;
 }
Пример #3
0
 public String getDel_label() {
   DCBindingContainer bd =
       (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
   DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
   Row currRow = it.getCurrentRow();
   Integer Del = (Integer) currRow.getAttribute("Deleted");
   String RetStr = null;
   if (Del == 0) {
     RetStr = "Пометить на удаление";
   } else {
     RetStr = "Снять пометку на удаление";
   }
   return RetStr;
 }
Пример #4
0
 public void onDeleteDialog(DialogEvent dialogEvent) {
   if (dialogEvent.getOutcome().name().equals("ok")) {
     DCBindingContainer bd =
         (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
     DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
     Row currRow = it.getCurrentRow();
     Integer Del = (Integer) currRow.getAttribute("Deleted");
     if (Del == 0) {
       BindingContainer binding = BindingContext.getCurrent().getCurrentBindingsEntry();
       OperationBinding ob = binding.getOperationBinding("Delete1");
       ob.execute();
     } else {
       currRow.setAttribute("Deleted", 0);
     }
     commitChange();
   }
 }
Пример #5
0
  public void onPaySettChange(ValueChangeEvent valueChangeEvent) {
    valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
    // System.out.println(vce.getNewValue());
    String pId = getValueFrmExpression("#{row.bindings.PayId.attributeValue}");
    System.out.println(pId);
    DCBindingContainer bd =
        (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding it = bd.findIteratorBinding("KontragSettingsView1Iterator");
    Row currRow = it.getCurrentRow();
    currRow.setAttribute("Summa", null);

    BindingContainer binding = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding ob = binding.getOperationBinding("retrieveSumm");

    if (ob != null) {
      ob.getParamsMap().put("pId", pId);
      BigDecimal summa = (BigDecimal) ob.execute();
      System.out.println(summa);
      currRow.setAttribute("Summa", summa);
    }
  }
Пример #6
0
 public void onValueChange(ValueChangeEvent valueChangeEvent) {
   // Add event code here...
   ArrayList selectedList = null;
   if (valueChangeEvent.getOldValue().equals(valueChangeEvent.getNewValue())) return;
   selectedList = (ArrayList) valueChangeEvent.getNewValue();
   DCBindingContainer bc = (DCBindingContainer) getBindings();
   DCIteratorBinding ir = (DCIteratorBinding) bc.findIteratorBinding("DayWeekVO1Iterator");
   Row row = ir.getCurrentRow();
   List unselectedDays = new ArrayList();
   unselectedDays.addAll(daysOfWeek);
   if (selectedList != null) {
     Iterator itr = selectedList.iterator();
     while (itr.hasNext()) {
       row.setAttribute(itr.next().toString(), "Y");
     }
     unselectedDays.removeAll(selectedList);
   }
   Iterator itr = unselectedDays.iterator();
   while (itr.hasNext()) {
     row.setAttribute((String) itr.next(), "N");
   }
 }
Пример #7
0
  public void refresh() {
    DCBindingContainer binding =
        (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding it = binding.findIteratorBinding("KontragOtherView1Iterator");
    String rks;
    if (it != null) {
      try {
        rks = it.getCurrentRow().getKey().toStringFormat(true);
      } catch (Exception e) {
        rks = null;
      }
      it.executeQuery();
      if (rks != null) {
        try {
          it.setCurrentRowWithKey(rks);
        } catch (Exception e) {
          e.getMessage();
        }
      }
    }

    AdfFacesContext.getCurrentInstance().addPartialTarget(getMainTable());
  }
  public void loadPersonalDetails() {
    DCBindingContainer bindings =
        (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();

    JUCtrlAttrsBinding PersonIDUpDt = (JUCtrlAttrsBinding) bindings.findNamedObject("PersonIDUpDt");
    JUCtrlAttrsBinding PersonIDGet = (JUCtrlAttrsBinding) bindings.findNamedObject("PersonID");
    PersonIDUpDt.setAttribute("PersonID", PersonIDGet.getAttribute("PersonID"));

    JUCtrlAttrsBinding PersonNumbereGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("PartyNumberGet");
    JUCtrlAttrsBinding PersonNumberUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("PartyNumberUpDt");
    PersonNumberUpDt.setAttribute("PartyNumber", PersonNumbereGet.getAttribute("PartyNumber"));

    JUCtrlAttrsBinding PersonTitleGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("PersonTitleGet");
    JUCtrlAttrsBinding PersonTitleUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("PersonTitleUpDt");
    PersonTitleUpDt.setAttribute("PersonTitle", PersonTitleGet.getAttribute("PersonTitle"));

    JUCtrlAttrsBinding FirstNameGet = (JUCtrlAttrsBinding) bindings.findNamedObject("FirstNameGet");
    JUCtrlAttrsBinding FirstNameUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("FirstNameUpDt");
    FirstNameUpDt.setAttribute("FirstName", FirstNameGet.getAttribute("FirstName"));

    JUCtrlAttrsBinding MiddleNameGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("MiddleNameGet");
    JUCtrlAttrsBinding MiddleNameUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("MiddleNameUpDt");
    MiddleNameUpDt.setAttribute("MiddleName", MiddleNameGet.getAttribute("MiddleName"));

    JUCtrlAttrsBinding LastNameGet = (JUCtrlAttrsBinding) bindings.findNamedObject("LastNameGet");
    JUCtrlAttrsBinding LastNameUpDt = (JUCtrlAttrsBinding) bindings.findNamedObject("LastNameUpDt");
    LastNameUpDt.setAttribute("LastName", LastNameGet.getAttribute("LastName"));

    JUCtrlAttrsBinding NameSuffixGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("NameSuffixGet");
    JUCtrlAttrsBinding NameSuffixUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("NameSuffixUpDt");
    NameSuffixUpDt.setAttribute("NameSuffix", NameSuffixGet.getAttribute("NameSuffix"));

    JUCtrlAttrsBinding emailIDUpDt = (JUCtrlAttrsBinding) bindings.findNamedObject("EmailIDUpDt");
    JUCtrlAttrsBinding emailAddressUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("EmailAddressUpDt");
    JUCtrlAttrsBinding emailIDGet = (JUCtrlAttrsBinding) bindings.findNamedObject("EmailIDGet");
    JUCtrlAttrsBinding emailAddressGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("EmailAddressGet");

    emailIDUpDt.setAttribute("EmailID", emailIDGet.getAttribute("EmailID"));
    emailAddressUpDt.setAttribute("EmailAddress", emailAddressGet.getAttribute("EmailAddress"));

    JUCtrlAttrsBinding DateOfBirthGet =
        (JUCtrlAttrsBinding) bindings.findNamedObject("DateOfBirthGet");
    JUCtrlAttrsBinding DateOfBirthUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("DateOfBirthUpDt");
    DateOfBirthUpDt.setAttribute("DateOfBirth", DateOfBirthGet.getAttribute("DateOfBirth"));

    JUCtrlAttrsBinding GenderGet = (JUCtrlAttrsBinding) bindings.findNamedObject("GenderGet");
    JUCtrlAttrsBinding GenderUpDt = (JUCtrlAttrsBinding) bindings.findNamedObject("GenderUpDt");
    GenderUpDt.setAttribute("Gender", GenderGet.getAttribute("Gender"));

    JUCtrlAttrsBinding PTRNumberGet = (JUCtrlAttrsBinding) bindings.findNamedObject("PTRNumberGet");
    JUCtrlAttrsBinding PTRNumberUpDt =
        (JUCtrlAttrsBinding) bindings.findNamedObject("PTRNumberUpDt");
    PTRNumberUpDt.setAttribute("PTRNumber", PTRNumberGet.getAttribute("PTRNumber"));

    /*################################################################################################ */
    JUCtrlAttrsBinding attribute11 = (JUCtrlAttrsBinding) bindings.findNamedObject("Attribute11");
    attribute11.setAttribute("Attribute11", "N");

    DCIteratorBinding credIter = bindings.findIteratorBinding("CredentialIterator");
    Row[] credRowsUpDt = credIter.getAllRowsInRange();
    if (credRowsUpDt != null) {
      for (int j = 0; j < credRowsUpDt.length; j++) {
        if (credRowsUpDt[j].getAttribute("Value") != null) {
          credRowsUpDt[j].setAttribute("ID", "");
          credRowsUpDt[j].setAttribute("Value", "");
          credRowsUpDt[j].setAttribute("StatusFlag", "");
        }
      }
    }

    /*################################################################################################ */

  }