Monday, January 23, 2012

Key Sample: How to find row from viewobject based on key attribute

DCBindingContainer dbc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = dbc.findIteratorBinding("EmployeeIterator");
Key k1 = new Key(new Object[]{100}); //employee id
Row[] r1 = iter.getViewObject().findByKey(k1, 1);
for(Row r: r1){
System.out.println(r.getAttribute(0)+" "+r.getAttribute(1));
}