In case when data is coming from any webservice and you need to update any viewobject based on the updates the user is doing on UI table. The logic is to capture key of each row of UI table and find the key in the viewobject, get corresponding records and update the values as in table using below code. I have writtten it on button action.
public String cb1_action() {
// Add event code here...
RichTable table = this.getDtlTable();
System.out.println("Row Count:"+table.getRowCount());
Number keyValuePK;
// for (int i = 0; i < table.getRowCount(); i++)
// {
Row row = ((JUCtrlHierNodeBinding)table.getRowData(10)).getRow();
System.out.println(row.getAttribute(1)+" "+row.getAttribute(2));
keyValuePK = (Number)row.getAttribute("PrimaryFieldId"); //tenth row
System.out.println("Key Value: "+keyValuePK);
row.getAttribute("PrimaryFieldId");
//}
DCBindingContainer dbc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = (DCIteratorBinding)dbc.findIteratorBinding("IteratorName");
Key k1 = new Key(new Object[]{keyValuePK}); //employee id
Row[] r1 = iter.getViewObject().findByKey(k1, 1);
System.out.println(r1[0].getAttribute("PrimaryFieldId")+" "+r1[0].getAttribute("AnyotherDesc"));
r1[0].setAttribute("UpdateAnyAttr", 99999);
// row = iter.findRowsByKeyValues((Key[])row.getAttribute("SubmHeadId")) ;
return null;
}
This blog will cover Oracle ADF, Weblogic, Oracle Application Server, Oracle Collaboration Suite etc....
Thursday, February 16, 2012
Wednesday, February 15, 2012
Map Example
package view;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class MapExample {
public static void main(String[] args) {
Map
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class MapExample {
public static void main(String[] args) {
Map
Tuesday, February 7, 2012
Search Criteria - View Criteria
Create view criterias against a view object (you can also have lov in the view criteria fields i.e. by defining the attribute as selectively required, as in screeshot).
In your datacontrol panel inside named criteria
, you will see this viewcriteria drag and drop it as ADF Query panel with table.
In your datacontrol panel inside named criteria
, you will see this viewcriteria drag and drop it as ADF Query panel with table.
Subscribe to:
Posts (Atom)