Sometimes user need to set current row in ADF table through programming. There is an Operation available on all View Object Instance inside Data Control.
So I am describing steps how to achieve this.
- First Create Action Binding for “setCurrentRowWithKeyValue” operation.
- After that create a method on ManagedBean to set Current Row.
BindingContext bindingctx = BindingContext.getCurrent(); BindingContainer binding =bindingctx.getCurrentBindingsEntry();OperationBinding opt =binding.getOperationBinding("setCurrentRowWithKeyValue"); opt.getParamsMap().put("rowKey",no); opt.execute();
where “no” is primary key value of ViewObject which you want to set (for eg if View object have srno primary key attribute and value like 1,2,3,4 and you want to set value which have primary key value ” 3” so you can pass 3 in place of no).