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; }
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; }
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; }
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(); } }
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); } }
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"); } }
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()); }