Issue in programmatic view object.

Hi,
I am creating a programmatic view object, in a button's action listener. I have used ViewObject.clearcache() to flush the VO previous data, every time the button is clicked and load new data. The issue which i face, is that the table showing the VO data, shows data in alternate attempts i.e. 1st,3rd and 5th button click and in the 2nd, 4th click it shows "No data to display." . If i try using ViewObject.reset() the table is loaded with data every time but the new result set gets appended, which gives duplicate data.
Please help.
Regards,
Max

Hi Navaneeth,
The code snippet is :
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dciterator=bindings.findIteratorBinding("AccountSummaryMCANViewObj1Iterator");
ViewObject serviceVO=dciterator.getViewObject();
webGetVruxDataService = new WebGetVruxDataService();
WebGetVruxDataPortType webGetVruxDataPortType =
webGetVruxDataService.getWebGetVruxDataPort();
Map<String, Object> requestContext =
((BindingProvider)webGetVruxDataPortType).getRequestContext();
requestContext.put(BindingProvider.USERNAME_PROPERTY,
"ladwpcom");
requestContext.put(BindingProvider.PASSWORD_PROPERTY,
"0bama8");
System.setProperty("javax.net.ssl.trustStore",
"/webdata/Oracle/Middleware/user_projects/domains/ladwp-test/security/cacerts");
ObjectFactory objFact = new ObjectFactory();
HostBridgeVruxRequestCt reqct =
objFact.createHostBridgeVruxRequestCt();
String autoPayment = "";
if(serviceVO!=null)
serviceVO.clearCache();
for (int i = 0; i < canCount; i++) {
// System.out.println(i);
reqct.setCAN(userCANArray);
serviceVO.insertRow(serviceVO.createRow());
Row serviceVORow=serviceVO.getCurrentRow();
HostBridgeVruxResponseCt responseCT =
webGetVruxDataPortType.webGetVruxDataOperation(reqct);
String acctName = responseCT.getVrux().getACCTNO();
serviceVORow.setAttribute("ACCOUNTNAME", acctName);
Double currBalance =
Double.parseDouble(responseCT.getVrux().getTotalPendingAmount().toString());
serviceVORow.setAttribute("CURRENTBALANCE", currBalance);
//TODO code for date
String dDate = responseCT.getVrux().getCDATE();
String dMonth = dDate.substring(0, 2);
String dDay = dDate.substring(2, 4);
String formatteddate = dMonth + "/" + dDay;
String dueDate = formatteddate;
serviceVORow.setAttribute("DUEDATE", dueDate);
if (responseCT.getVrux().getBANKFLG().equals("2")) {
autoPayment = "Enrolled";
} else {
autoPayment = "Not Enrolled";
serviceVORow.setAttribute("AUTOMATICPAYMENT", autoPayment);
// System.out.println(serviceVORow.getAttribute("AUTOMATICPAYMENT"));
serviceVORow.setAttribute("PAYNOW", "");
AdfFacesContext.getCurrentInstance().addPartialTarget(this.mcANTable);
Regards,
Max

Similar Messages

  • Programmatic View Object

    I'm trying to create a programmatic view object from an Oracle Stored procedure that returns a single row containing Oracle Object Types. I created a Domain for my Oracle Object type called BillingInfo. Here is the code for my view object so far:
    package billing;
    import billing.common.BillingInfo;
    import java.lang.Integer;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import oracle.jbo.JboException;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle Business Components for Java.
    public class BillingInfoViewImpl extends ViewObjectImpl
    // billing info procedure call variables
    private final static int BILLING_LOGGED_ON_USER_ID = 0;
    private final static int BILLING_BILL_TO_USER_ID = 1;
    private final static int BILLING_TRANSACTION_DATE = 2;
    private final static int BILLING_TRANSACTION_DETAILS1 = 3;
    private final static int BILLING_TRANSACTION_DETAILS2 = 4;
    private final static int BILLING_TRANSACTION_DETAILS3 = 5;
    private final static int BILLING_TRANSACTION_DETAILS4 = 6;
    private final static int BILLING_TRANSACTION_DETAILS5 = 7;
    private final static int BILLING_TRANSACTION_COUNT = 8;
    private final static int BILLING_TOTAL_CHARGE_AMOUNT = 9;
    private final static int BILLING_PAY_TYPE = 10;
    private final static int BILLING_ERROR_MESSAGE = 11;
    private final static int BILLING_ERROR_CODE = 12;
    private final static int BILLING_RETURN_VALUE = 13; /*
    * This is the PLSQL block that we will execute
    private static final String SQL =
    "begin ecs_jdbc_wrappers.get_billing_info_jdbc(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,?, ?, ?);end;";
    * This is the default constructor (do not remove)
    public BillingInfoViewImpl() { }
    * Overridden framework method.
    * Executed when the framework needs to issue the database query for
    * the query collection based on this view object. One view object
    * can produce many related result sets, each potentially the result
    * of different bind variable values. If the rowset in query is involved
    * in a framework-coordinated master/detail viewlink, then the params array
    * will contain one or more framework-supplied bind parameters. If there
    * are any user-supplied bind parameter values, they will PRECEED the
    * framework-supplied bind variable values in the params array, and the
    * number of user parameters will be indicated by the value of the
    * numUserParams argument.
    protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
    * If there are where-clause params they will be in the 'params' array.
    * NOTE: Due to Bug#2828248 I have to cast to BigDecimal for now,
    * ---- but this parameter value should be oracle.jbo.domain.Number type.
    int sqlcode = 0; // statement sql code
    String errorMessage = null; // statement error message
    String loggedOnUserId = null; // IN VARCHAR2
    String billToUserId = null; // IN VARCHAR2
    Date transactionDate = new Date(); // IN DATE
    BillingInfo transactionDetails1 = null; // IN OUT billing_info
    BillingInfo transactionDetails2 = null;
    BillingInfo transactionDetails3 = null;
    BillingInfo transactionDetails4 = null;
    BillingInfo transactionDetails5 = null;
    int transDetailsCount = 0; // IN INTEGER
    String payType = null; // IN VARCHAR2
    if (params != null)
    loggedOnUserId = (String)params[BILLING_LOGGED_ON_USER_ID];
    System.out.println("USER ID:" + loggedOnUserId);
    billToUserId = (String)params[BILLING_BILL_TO_USER_ID];
    System.out.println("BILLED USER ID:" + billToUserId);
    if (params[BILLING_TRANSACTION_DETAILS1] != null) {
    System.out.println(params[BILLING_TRANSACTION_DETAILS1]);
    transactionDetails1 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS1];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS2] != null) {
    transactionDetails2 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS2];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS3] != null) {
    transactionDetails3 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS3];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS4] != null) {
    transactionDetails4 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS4];
    transDetailsCount = transDetailsCount + 1;
    if (params[BILLING_TRANSACTION_DETAILS5] != null) {
    transactionDetails5 = (BillingInfo)params[BILLING_TRANSACTION_DETAILS5];
    transDetailsCount = transDetailsCount + 1;
    payType = (String)params[BILLING_PAY_TYPE];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Set the value of the bind variables
    st.setString(1, loggedOnUserId);
    st.setString(2, billToUserId);
    // Set Transaction Date to todays date
    java.sql.Timestamp sqlTs = new java.sql.Timestamp(transactionDate.getTime());
    st.setTimestamp(3, sqlTs);
    System.out.println("TRANS DATE:" + sqlTs);
    st.setObject(4, transactionDetails1);
    if (transactionDetails2 == null) st.setNull(5, Types.STRUCT, "BILLING_INFO");
    else st.setObject(5, transactionDetails1);
    if (transactionDetails3 == null) st.setNull(6, Types.STRUCT, "BILLING_INFO");
    else st.setObject(6, transactionDetails1);
    if (transactionDetails4 == null) st.setNull(7, Types.STRUCT, "BILLING_INFO");
    else st.setObject(7, transactionDetails1);
    if (transactionDetails5 == null) st.setNull(8, Types.STRUCT, "BILLING_INFO");
    else st.setObject(8, transactionDetails1);
    st.setInt(9, transDetailsCount);
    st.setString(11,payType);
    * Register OUT paramters
    st.registerOutParameter(4, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(5, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(6, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(7, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(8, Types.STRUCT, "BILLING_INFO");
    st.registerOutParameter(10, Types.DOUBLE);
    st.registerOutParameter(12, Types.VARCHAR);
    st.registerOutParameter(13, Types.INTEGER);
    st.registerOutParameter(14, Types.INTEGER);
    // execute the stored procedure
    st.execute();
    // get the SQLCODE
    sqlcode = st.getInt(13);
    System.out.println("sqlcode returned:" + sqlcode);
    errorMessage = st.getString(12);
    System.out.println("Error Message:" + errorMessage);
    catch (SQLException s) {
    System.out.println("sqlcode returned:" + sqlcode);
    System.out.println("Error Message:" + errorMessage);
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    super.executeQueryForCollection(qc, params, numUserParams);
    This almost works except when I try to print out the attributes I get an error. I beleive I have to override some of the view object framework methods. If so, how do I go about this? Is it the same methods overridden in this example Getting a View Object's Result Rows from a REF CURSOR? http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html
    Nat

    Yes. only difference is that your VO will just have one row in it.

  • Programmatic View Objects + View Links

    Ive constructed some programmatic view objects to grab data from 2 custom java business services (for example: Persons and Addresses). The reasons for them being custom and separate are out of my control.
    I need to easily represent a relationship between these 2 view objects so Ive constructed a ViewLink between them. However I cant figure out exactly what ADF needs from me in terms of method implementations in my ViewObjects?
    When I drop the master data control onto a JSF via a Tree table, it looks as though its not actually filtering the detail rows. I.e. if master is a Person, and detail objects are Addresses, each Person tree node has all Addresses under it. Im assuming this is because the Address ViewObject is programmatic and so ADF doesn't know how to filter the results?
    How can I setup this ViewLink between 2 programmatic ViewObjects such that the ViewLink works like its supposed to?

    Hello,
    Steve Muench´s sample 132 implements what you are trying to accomplish. Inspect the sample and let us know if you have questions about it.
    http://blogs.oracle.com/smuenchadf/resource/examples#132
    Juan C.

  • View Link on two programmatic view objects

    Hello,
    I use Build JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407
    I have two programmatic View Objects with data from other sources (an ArrayList in my example).
    Now I would like to create a View Link on it. How can I do this?
    I'm quite new on Java and ADF...
    I know it is possible because I already found Steve's example 132 here [http://blogs.oracle.com/smuenchadf/examples/|http://blogs.oracle.com/smuenchadf/examples/]
    But could somebody create a simple example based on my example classes below (which is understandable for a newbie like me ;-) ?
    Has been asked already here, but I did not found a solution as yet.
    Error with view link and ADF table Tree
    This is my example code for the view objects:
    Employee.java:
    private Number empno;
    private String ename;
    private Number dept;
    with getters and setters...
    Department.java
    private Number deptno;
    private String dname;
    with getters and setters...
    public class StaticDataDepartmentsImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Department> departments = new ArrayList<Department>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    populateAttributeForRow(r, 0, departments.get(pos).getDeptno());
    populateAttributeForRow(r, 1, departments.get(pos).getDname());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (departments != null) ? departments.size() : 0;
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Department d1 = new Department();
    d1.setDeptno(new Number(10));
    d1.setDname("IT");
    Department d2 = new Department();
    d2.setDeptno(new Number(20));
    d2.setDname("HR");
    departments.add(d1);
    departments.add(d2);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    public class StaticDataEmployeesImpl extends ViewObjectImpl {
    int rows = -1;
    private List<Employee> employees = new ArrayList<Employee>();
    protected void executeQueryForCollection(Object rowset, Object[] params,
    int noUserParams) {
    // Initialize our fetch position for the query collection
    setFetchPos(rowset, 0);
    System.out.println("in executeQueryForCollection");
    super.executeQueryForCollection(rowset, params, noUserParams);
    // Help the hasNext() method know if there are more rows to fetch or not
    protected boolean hasNextForCollection(Object rowset) {
    System.out.println("in hasNextForCollection. Rows:" + rows);
    return getFetchPos(rowset) < rows;
    // Create and populate the "next" row in the rowset when needed
    protected ViewRowImpl createRowFromResultSet(Object rowset,ResultSet rs) {
    ViewRowImpl r = createNewRowForCollection(rowset);
    int pos = getFetchPos(rowset);
    System.out.println("in createRowFromResultSet. Pos=" + pos);
    populateAttributeForRow(r, 0, employees.get(pos).getEmpno());
    populateAttributeForRow(r, 1, employees.get(pos).getEname());
    populateAttributeForRow(r, 2, employees.get(pos).getDept());
    setFetchPos(rowset, pos + 1);
    return r;
    // When created, initialize static data and remove trace of any SQL query
    protected void create() {
    super.create();
    // Setup string arrays of codes and values from VO custom properties
    initializeStaticData();
    rows = (employees != null) ? employees.size() : 0;
    System.out.println("in create(). Rows=" + rows);
    // Wipe out all traces of a query for this VO
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    // Return the estimatedRowCount of the collection
    public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
    return rows;
    // Subclasses override this to initialize their static data
    protected void initializeStaticData() {
    Employee e1 = new Employee();
    e1.setEmpno(new Number(2333));
    e1.setEname("Emp1");
    e1.setDept(new Number(10));
    Employee e2 = new Employee();
    e2.setEmpno(new Number(1199));
    e2.setEname("Emp2");
    e2.setDept(new Number(20));
    Employee e3 = new Employee();
    e3.setEmpno(new Number(3433));
    e3.setEname("Emp3");
    e3.setDept(new Number(10));
    Employee e4 = new Employee();
    e4.setEmpno(new Number(5599));
    e4.setEname("Emp4");
    e4.setDept(new Number(20));
    Employee e5 = new Employee();
    e5.setEmpno(new Number(5676));
    e5.setEname("Emp5");
    e5.setDept(new Number(10));
    Employee e6 = new Employee();
    e6.setEmpno(new Number(7867));
    e6.setEname("Emp6");
    e6.setDept(new Number(20));
    employees.add(e1);
    employees.add(e2);
    employees.add(e3);
    employees.add(e4);
    employees.add(e5);
    employees.add(e6);
    // Store the current fetch position in the user data context
    private void setFetchPos(Object rowset, int pos) {
    if (pos == rows) {
    setFetchCompleteForCollection(rowset, true);
    setUserDataForCollection(rowset, new Integer(pos));
    // Get the current fetch position from the user data context
    private int getFetchPos(Object rowset) {
    return ((Integer)getUserDataForCollection(rowset)).intValue();
    Who can help?
    Thnx in advance!
    Rolf

    Rolf,
    I guess when we try to do it for you, we end up with almost the sample code provided by Steve Muench.
    So there from my point of view it doesn't make sense to do it all over.
    Take some time and study the sample code, run it without changes and after that try some changes which suits your use case better.
    If you don't understand what's going on in the sample post the question here and we try to help you.
    Timo

  • View Links for Programmatic View Objects

    Hi All,
    I created a read only VO called MyVO based on a sql query.
    I created 2 programmatic view objects, MasterView and ChildView.
    In a custom method in AMImpl class ,I iterate through this MyVO resultset and get the rows in a Row object.
    Based on some attributes values of the Row, I populate both master and child View Objects.
    I have created a view link between Master and Child Programmatic View Objects and have exposed them in AM.
    Now I run the AM, and run the method exposed in client interface.
    Now I click on my master and child programmatic views.
    I see that the rows are populated in both of these programmatic VOs.
    But when I click on viewlink which I have exposed under master, it doesnt show me any
    record for child.
    This is my method of AMImpl which is exposed in AM client interface.
    public void constructLines(){
    ViewObject vo= this.getMyVO1();
    ViewObject master=this.getTransientVO1();
    ViewObject child=this.getTransientLineVO1();
    Row r,masterRow,childRow;
    int count=0;
    while(vo.hasNext()){
    ++count;
    r=vo.next();
    masterRow = master.createRow();
    if(r.getAttribute("QuoteHeaderId")!=null)
    masterRow.setAttribute("QuoteHeaderId",
    r.getAttribute("QuoteHeaderId").toString());
    if(r.getAttribute("QuoteLineId")!=null)
    masterRow.setAttribute("QuoteLineId",
    r.getAttribute("QuoteLineId").toString());
    if(r.getAttribute("LineNumber")!=null)
    masterRow.setAttribute("LineNumber",
    r.getAttribute("LineNumber").toString());
    master.insertRow(masterRow);
    childRow= child.createRow();
    if(r.getAttribute("RefLineId")!=null)
    childRow.setAttribute("RefLineId",
    r.getAttribute("QuoteLineId").toString());
    if(r.getAttribute("QuoteHeaderId")!=null)
    childRow.setAttribute("QuoteHeaderId",
    r.getAttribute("QuoteHeaderId").toString());
    child.insertRow(childRow);
    This is stopping me from my development progress.
    Any suggestion to solve this will be of great help.
    Thanks,
    Prabhanjan

    Hi..
    have you define relationship correctly between masterVO and childVO.sometime there may be the problem.

  • Changing a Programmatic View Object's query at run-time

    Hi,
    I've created a programmatic View Object using the information in '35.9.3 Key Framework Methods to Override for Programmatic View Objects' in the Oracle Middleware Fusion Guide and bound it to a BarChart. This has worked fine using the following:
    String myColumn = "Quant1";
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    String myQuery = "SELECT Service as MyService, " + myColumn + " as MyValue FROM ColumnTestTable WHERE 1 = 1";
    getViewDef().setQuery(myQuery);
    setQuery(myQuery);
    I also have my data updating automatically. I have public properties in my viewObjImpl class which I can set and update the value of myColumn. I then thought it would just be a case of re-calling the create() method and the SQL would be updated and my chart would auto-update using the new column to select it's values, the value of the property updates and the create method is called but the chart doesn't display any different data and stops auto-updating. Does anybody know if this is possible and if so what I may have missed?
    Cheers, Tom

    Hi Timo,
    I moved everything to a different public method and solved the problem by firing the execute() method which I hadn't been doing previously and the chart updates with the correct data.
    However, once I execute the SQL my chart stops auto-updating with changes to the data in the database - do you know how I update the SQL query but keep my chart auto-updating? Perhaps I have to re-register for the registerDatabaseChangeListener for the query collection?
    Thanks in advance, Tom

  • ViewLink between DB and Programmatic View Objects

    Im using programmatic view objects as described in #132 of http://blogs.oracle.com/smuenchadf/resource/examples
    I can create view links between these programmatic view objects, but when I create a ViewLink from a DB ViewObject to a programmatic view object, the programmatic one fails to see the view link when invoked, and therefore doesnt return the correct detail objects.
    Has anyone created a view link like this before? If so, can I see the code or an example?

    If you look at example #132 above, you'll see a ListOfMapsDataProviderViewObjectImpl - which is a custom ViewObject that delivers data programmatically. There's a method in this object "getFilterCriteria(..)" that looks at the parameters delivered to the ViewObject, and any ViewLinks, to produce a map of parameters that the underlying DataProvider can use to filter its data. When you setup a ViewLink between two of these ViewObjects you may see a filter on a foreign key, since the master view object is retrieving its detail objects. However, when the master object is a standard database view object, the view link doesnt work, i.e. the getFilterCriteria method does not see the view link when it calls ViewObjectImpl.getViewLinks().

  • Polymorphism in programmatic view objects

    We are trying to benefit from viewobject polymorphism. We have Programmatic VOs that directly talk to a service and do not have any backing EOs. Hierarchy is like follows:
    - Annot
    - VisualAnnot
    - StampAnnot
    - TextAnnot
    - NonVisualAnnot
    We need to get a collection of polymorphic rows when we get a list of Annots. We have defined StampAnnot and TextAnnot as subtypes of Annot in AM. However, all the rows that we get are of type Annot with the minimal set of attributes Annot should have, and not the StampAnnot or TextAnnot with additioanal attributes.
    We tried overwriting createRowFromResultSet() method in Annot VO so that we can generate the row of appropriate type. However, that also does not work because we still use ViewDef of Annot and attribute validation fails. Our questions are:
    - Why polymorphism is not working in our case while we have defined a discriminator field and have the proper subtypes define in our AM? Should one must have EOs to make polymorphism work?
    - If we need to overwrite some additional framework methods, any advice or sample to help us with that?
    thanks and regards

    Hello,
    Steve Muench´s sample 132 implements what you are trying to accomplish. Inspect the sample and let us know if you have questions about it.
    http://blogs.oracle.com/smuenchadf/resource/examples#132
    Juan C.

  • Populate Programmatic View Objet at runtime

    Hi All,
    I have a requirement to switch between three different data source at runtime in one page. The UI and field names are the same for those three cases but data is coming from different sources (queries).
    So, imagine that we have 3 view objects that implemented as read only (query based view object) and we want to populate one view object at runtime as a main data source for my page.
    My idea is to use "Prgorammatic View Object" for that main data source and then dynamically populate its content from one of the three read-only view objects based on a parameter provided by user selection.
    First of all, I want to know whether this is fine approach and if so, then get some points about implementation or any other sample.
    I have found this sample:
    http://techiecook.wordpress.com/2011/05/17/programmatically-populate-view-objects-in-oracle-adf/
    Thanks in advance,
    Nasser

    Hi,
    this more is a use case for adaptive bindings. See:https://blogs.oracle.com/groundside/entry/towards_ultra_reusability_for_adf
    You can use EL to change the ViewObject name an iterator in ADF queries its data from. So the switch would be on the binding layer and there is no need for programmatic view objects. Unlike in the above blog article, the 3 VO exist in your case so you don't need to create them on the fly. Just change the VO name in the referenced managed bean
    Frank

  • ADF View Object filtering

    Hi, This question is related to ADF table filters.
    Let us take an example of a View Object that is being dropped in a jspx page as a "ADF Table" with filters.
    Whenever user applies a filter on a column, will the data for view object be queried from database once again?
    Is there a way to avoid the query re-execution on applying filters in table.

    Thanks for the replies. Jdeveloper version we use is 11.1.1.6.
    I have a follow up question.
    We have a programmatic View Object which gets data from 3 different rows and populate them in view rows (We have overridden standard methods like executeQueryForCollection..etc)
    The data is displayed in a ADF table.
    Now when the user filters data, normally filter works fine but the web service calls are made every time the filters are applied/removed.
    We would like to avoid making calls to web services when user filters data by setting Query Mode to "QUERY_MODE_SCAN_VIEW_ROWS".
    But what happens is first time filter is applied, the filtered rows are displayed properly but from there on the query collection refers to filtered data only and not the complete data set.
    So when the user removes filter and hits enter again only filtered rows are displayed and not all the rows fetched initially. I am not sure why the query collection looses all the rows and keeps only filtered rows??

  • Where the programmatic views will be stored in Database.

    Hi, All
    what will be the scope of the views which are created programmatically in database.
    will they store in any temporary tabels in the database, could anybody provide any Idea.
    Thanks in Advance.
    Renuka

    Renuka,
    Even though we do not require any database object like (views / synonyms) to create programmatic view object we need a database connection to initially create the ProgViewObject. From where does your data come from? Other Datasources than DB?
    And as you explained ViewObjects will only be occupied in Application Level not in the DB Used for BC Objects.
    In that case even if we have ProgViewObjects in BC project in a big number is should not be a performance impact from the Application side on the underlying used DB for that App. Correct???????? Not really. ViewObjects themselves does not need any space in DB (they are simple XML files - with or without related java classes). However, the VO would need to contact the DB for fetching the data. If you are not using the Database (that you've used to create a connection), to fetch the data (and using some other Data Source), then the answer for your question is Yes. There would not be a performance impact on the underlying DB. However, there would be on the Data Source you are using for the Programmatic VOs.
    -Arun

  • Jdev 1013  ADF - View Object not bound - Refreshed page not showing ctrls

    I have a view object that i am using for input form on a page by exposing in a data control.
    When the form is submitted it does some db operation based on user input and comes back.
    My problem is when i enter the same page again for doing another operation of the same kind,
    i refresh this view object in one of the application module's methods.
    When the page shows up eventually, i am not finding the input fields on them.
    I guess there is some sort of binding issue to the view object here.
    The code in the application module's method to refresh the view module is as simple as:
    getVParams().clearCache();
    VParamsRowImpl row =
    (VParamsRowImpl )getVParams().createRow();
    row.setValue(100);
    getVParams().insertRow(row);
    Any idea why the bindings is not picking up the new row and connecting it to the form?
    By the way i am calling the same method when displaying the form for the first time it works. Only
    the subsequent calls to the form messes up.
    Any help will be much appreciated.

    Yes i am calling my custom method in application module. I understood that the same page bindings get invoked in two parts, once when the page is loaded and once when the values are submitted by the user. When the bindings are executed when the user is submitting the data from the page adfFacesContext.postback is true and at that i am not interested in creating the new row again by calling my method. Hence this condition in invokeAction. When i debug, the methods are getting called properly. Only when the page is rendered again, it is not picking up the new row.
    I am working around this now, by creating the row only once from the appmodule's method and then reusing the same created row in subsequent loadings by resetting the attributes alone.

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All,
    I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
    I'm facing following two errors while trying to run the app module:
    1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
    2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
    I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
    [http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
    [http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
    Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
    ///////////App Module Implementation Class/////////////////////////
    public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
    private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
    * This is the default constructor (do not remove).
    public DynamicEntityGenModuleImpl() {
    public ViewObjectImpl getDepartmentsView1() {
    return (ViewObjectImpl) findViewObject("DynamicDeptVO");
    public void buildDynamicDeptComp() {
    ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
    if (internalDynamicVO != null) {
    System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
    return;
    EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
    ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
    addViewToPdefApplicationModule(viewDef);
    private EntityDefImpl buildDeptEntitySessionDef() {
    try {
    EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
    entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setName(entDef.getName());
    System.out.println("Application Module Path name: " + getDefFullName());
    System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setAliasName(entDef.getName());
    entDef.setSource("DEPT");
    entDef.setSourceType("table");
    entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
    entDef.addAttribute("Name", "NAME", String.class, false, false, true);
    entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
    entDef.resolveDefObject();
    entDef.registerSessionDefObject();
    entDef.writeXMLContents();
    entDef.saveXMLContents();
    return entDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
    try {
    ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
    viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
    System.out.println("ViewDef :" + viewDef.getFileName());
    viewDef.setUseGlueCode(false);
    viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
    viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
    viewDef.addAllEntityAttributes("DynamicDeptUsage");
    viewDef.resolveDefObject();
    viewDef.registerSessionDefObject();
    viewDef.writeXMLContents();
    viewDef.saveXMLContents();
    return viewDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
    oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
    if (pDefAM == null) {
    pDefAM = new oracle.jbo.server.PDefApplicationModule();
    pDefAM.setFullName(getDefFullName());
    pDefAM.setEditable(true);
    pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
    pDefAM.applyPersonalization(this);
    pDefAM.writeXMLContents();
    pDefAM.saveXMLContents();
    ////////adf-config.xml//////////////////////
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:sec="http://xmlns.oracle.com/adf/security/config">
    <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults useBindVarsForViewCriteriaLiterals="true"/>
    <startup>
    <amconfig-overrides>
    <config:Database jbo.locking.mode="optimistic"/>
    </amconfig-overrides>
    </startup>
    </adf-adfm-config>
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
    </adf:adf-properties-child>
    <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
    </sec:adf-security-child>
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
    <namespace path="/model/" metadata-store-usage="mdsRepos"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property name="metadata-path" value="/tmp"/>
    <!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
    <property name="repository-name" value="TestDynamicEC"/>
    <property name="jdbc-userid" value="adfmay28"/>
    <property name="jdbc-password" value="adfmay28"/>
    <property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </adf-config>
    //////////////////////////////////////////////////////////////////////////////////////////////////////////

    Hi Frank,
    I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
    These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
    Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
    Nik

  • Create view link between two view objects (from programmatic data source)

    Hi Experts,
    Can we create a link between two view objects (they are created from programmatic datasource ; not from either entity or sql query). If yes how to create the link; ( i mean the like attributes?)
    I would also like to drag and drop that in my page so that i can see as top master form and the below child table. Assume in my program i will be only have one master object and many child objects.
    Any hits or idea pls.
    -t

    Easiest way to do this is to add additional transient attributes to your master view object, and then include those additional transient attributes in the list of source attributes for your view link. This way, you can get BC4J to automatically refer to their values with no additional code on your part.

  • [SOLVED] ADF BC : View Object "second level" Entity reference issue

    hi
    If I insert a row in a View Object that uses "two levels" of Entity references, the attributes of the Entity on the "second level" don't get a value.
    Consider these tables:
    MY_ROW (MY_ROW_ID, MY_ROW_STUFF, MY_ROW_LU1_ID)
    MY_ROW_LU1 (MY_ROW_LU1_ID, MY_ROW_LU1_STUFF, MY_ROW_LU1_LU1_ID)
    MY_ROW_LU1_LU1 (MY_ROW_LU1_LU1_ID, MY_ROW_LU1_LU1_STUFF)
    Where MY_ROW.MY_ROW_LU1_ID is a "look-up" in MY_ROW_LU1 and MY_ROW_LU1.MY_ROW_LU1_LU1_ID is a "second level look-up" in MY_ROW_LU1_LU1.
    I created default Entities and Associations on these tables and a View Object that uses all 3 Entities (MyRow as Updatable, MyRowLu1 and MyRowLu1Lu1 as Reference).
    See example code in
    http://verveja.footsteps.be/~verveja/files/oracle/ViewObjectEntityReferenceIssue-v0.03.zip
    (contains no Java code, all out-of-the-box ADF BC)
    problem scenario:
    If run the MyRowService Application Module in the Oracle Business Component Browser and "open" the MyRowViewAll View Object instance, I get the rows and their related "look-up values".
    If I click the "Insert a new record" button and fill out values for MyRowId, MyRowStuf and MyRowLu1IdEntity, I only get "look-up" values for the "first level". While the "second level" stays empty.
    For example, a MyRowLu1IdEntity of "2003" gives a MyRowLu1Stuff value of "2003 stuff", but no value in MyRowLu1Lu1Stuff.
    What am I doing wrong? What should I change to also get a value in the "second level" MyRowLu1Lu1Stuff attribute?
    many thanks
    Jan Vervecken

    Jan,
    If you create a view object on Emp and Dept, with Dept as a reference entity, you might choose to build the view object to only include the:
    Emp.Empno (required, since it's the PK of Emp entity usage)
    Emp.Ename (included since you want to show the ename)
    Dept.Deptno (required, since it's the PK of the Dept entity usage)
    Dept.Dname (included since you want to show the dname)
    The wizard enforces the inclusion of the required attributes above.
    When you run this view object, a join is performed and you see the reference data.
    Now, if you want to allow the user to UPDATE the reference data, you need to add one more attribute to the list of attributes:
    Emp.Empno
    Emp.Ename
    Emp.Deptno (To allow user to change Deptno employee belongs to)Dept.Deptno
    Dept.Dname
    At this point, not only is the join performed for you, but the ADF BC reference mechanism reacts to any modification of the Emp.Deptno attribute, correctly showing the reference information for that new foreign-key-referenced department (even before commiting and requerying, at which time the SQL join would pickup that correct, related information).
    The "second level" problem you describe in this thread is simply the same issue described here as a master/first-level-detail situation, taken to its logical next step. If you want the end-user to be able to change the second-level detail to which the first-level-detail is associated, you need to include the first-level-detail's foreign key attributes in the view object's select list. Otherwise, there is no foreign key attribute whose value-change event the framework can react to in order to coordinate the related reference data in the row.
    I've blogged a link to a working example of a four-level reference information view object here:
    http://radio.weblogs.com/0118231/2007/05/09.html#a818
    based on the HR schema.

Maybe you are looking for

  • Lost Data | Hard Drive Failure

    hello, after a series of unrecoverable crashes running safari, i tried running disk utilities from the start up disc, only to make matters worse. it won't boot up now. simply stalls while loading for about 15 minutes and shuts down entirely. i tried

  • Photo image quality in iMovie

    Hi ... I am attempting to create an iMovie that will include photos and video footage. I read that the best presentation quality for the photos would be achieved creating a slideshow in iPhoto and exporting the slideshow, and importing the resulting

  • Applying color groups to grouped art gets randomized

    Hey Guys,  I've been fighting with this issue for a bit over here. I have a collection of color groups, that I am applying to grouped objects, but every time I change out the color group, it randomizes the order which the colors are applied. In the k

  • If one has a license for Adobe Acrobat XI is there a need for an upgrade to use FormsCentral

    If one has a license for Adobe Acrobat XI is there a need for an upgrade to use FormsCentral

  • Why does my application begin Maximized (all of a sudden)?

    Hi, I am using netbeans 6.5.1 and JDK 6.0 and I am just teaching myself some basic stuff. I put together a small desktop application with just a few menus. When the application runs it begins in a small window in the middle of the screen. The window