ActionEvent ae = new ActionEvent(getCb1());
ae.queue();
Oracle ADF, JAVA/J2EE application developer. Through this blog i am sharing my experience and knowledge.
public String closeOrdActionRevertOrremoveRowValues() {
DCBindingContainer dcBindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding appointOrdersIter = dcBindings.findIteratorBinding("TWCYMTAppointmentOrdersVO1Iterator");
ViewObject appointOrdersVO = appointOrdersIter.getViewObject();
RowSetIterator OrdersIter = appointOrdersVO.createRowSetIterator(null);
while (OrdersIter.hasNext()) {
Row nextRow = OrdersIter.next();
if (nextRow.getAttribute("CheckRowStatusT") != null) {
Integer rowStatus = (Integer) nextRow.getAttribute("CheckRowStatusT");
if (rowStatus == 2) {
_logger.info("Modified Rows-" + nextRow.getAttribute("AppointmentNumber"));
revertChangesCurrentRow(nextRow);
} else if (rowStatus == 0) {
_logger.info("New Row Removed");
nextRow.remove();
}
}
}
appointOrdersVO.executeQuery();
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getAppointmentOrdersTbl());
//ViewObject vo1 = getViewObjectByIteratorName("TWCYMTAppointmentOrdersVO1Iterator");
int count = appointOrdersVO.getRowCount();
if (count > 0) {
bindAdd.setDisabled(false);
bindDelete.setDisabled(false);
bindSave.setDisabled(false);
bindOrdCancel.setDisabled(false);
}else{
bindDelete.setDisabled(true);
bindSave.setDisabled(true);
bindOrdCancel.setDisabled(true);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getAppointmentOrdersTbl());
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getBindAdd());
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getBindDelete());
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getBindSave());
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getBindOrdCancel());
AdfFacesContext.getCurrentInstance().addPartialTarget(this.getAppointmentOrdersTbl());
return null;
}
public void revertChangesCurrentRow(Row curRow) {
if (curRow != null) {
curRow.refresh(Row.REFRESH_UNDO_CHANGES | Row.REFRESH_WITH_DB_FORGET_CHANGES);
}
}
-Djbo.debugoutput=console