GetAttribute() method of a view object is returning NULL

Hi ,
I am trying to implement PPR in one of my OAF page and I have taken the following approach.
I have declared the follwing transient boolean attribute in the VO() apart from the existing attribute "Meaning" .
1.MfgEnttity
2.MfgAcct
3.MfgSubAcct
4.MfgCc
5.MfgProj
In the page I have used these attributes in the rendered property as "${oa.XXR2RMfgproSegVO.MfgSubAcct}" like this.
Now in the CO I have written the following code.
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initializeXXR2RMfgproSegVO");
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String event = pageContext.getParameter(EVENT_PARAM);
String source = pageContext.getParameter(SOURCE_PARAM);
OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
am.invokeMethod("handleSegmentChangeEvent");
And the AM code is as follows:
public void initializeXXR2RMfgproSegVO()
OAViewObject vo = getXXR2RMfgproSegVO();
if(!vo.isPreparedForExecution())
vo.executeQuery();
Row row = vo.createRow();
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
public void handleSegmentChangeEvent()
OAViewObject pVO = (OAViewObject)findViewObject("XXR2RMfgproSegVO");
OARow hdrRow = (OARow)pVO.getCurrentRow();
String status = (String)hdrRow.getAttribute("Meaning");
System.out.println("poRow "+ hdrRow.toString());
System.out.println("value of the status is "+ status);
if("Entity".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.TRUE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
} else
if("Account".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.TRUE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
}else
if("Subaccount".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.TRUE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
}else
if("Cost Center".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.TRUE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
} else
if("Project".equals(status))
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.TRUE);
else
hdrRow.setAttribute("MfgEnttity", Boolean.FALSE);
hdrRow.setAttribute("MfgAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgSubAcct", Boolean.FALSE);
hdrRow.setAttribute("MfgCc", Boolean.FALSE);
hdrRow.setAttribute("MfgProj", Boolean.FALSE);
Now when in the page I am changing the value of the attribute "Meaning" it is always getting into the else part i.e. where all the attributes are "False".
The two System.out.Println statements are returning the follwing values.
10/03/22 15:41:08 poRow [email protected]3
10/03/22 15:41:08 value of the status is null
Can you please suggest why this "Status" is returning NULL and how I can get the current row selected in the page?
Thanks
Subhabrata

Hi Pratap,
Thanks a lot for your reply.
Can you please suggest how can I rectify the code.I have tried commenting the AM code as follows
public void initializeXXR2RMfgproSegVO()
OAViewObject vo = getXXR2RMfgproSegVO();
if(!vo.isPreparedForExecution())
vo.executeQuery();
//Row row = vo.createRow();
//vo.insertRow(row);
//row.setNewRowState(Row.STATUS_INITIALIZED);
But in the page when I am selecting any segment its throwing Null pointer Exception.
I am new in OAF and this is an urgent client requirement.Please suggest me Where exactly I need to make change in my code.
Thanks in advance...
Thanks
Subhabrata

Similar Messages

  • Access to a method located in view object from JSP page?

    Hi,
    How can i access a public method which is loacted in view
    object "viewobjectImpl.java" from JSP page.

    Juan,
    Either via Data tags or/and Java embedded code.(<%...%>).
    This method, suppose to execute a stored procedure.
    Thanks

  • Problem extending standard ViewReceiptsSearchVO view object with logic on get method

    Hi All,
    EBS 12.1.3
    Database 11.2.0.3
    I am trying to extend the 3 VOs related to ViewReceiptsSearch.  I extended a seeded ViewReceiptsSearchVO view object.  I haven't made any changes yet, no columns added, nothing altered.  When I run this substitution, the "Received" column is null.  This column in the view used for the view object only selects NULL and uses the getter method for the attribute to populate the value.  The generated extension getter calls getAttributeInternal and skips the logic in the standard getter and the substituted view object is displaying the null in the screen.  The below discussion explains the problem very well except that the original posted had the issue in 11.5.10.2.  I am having this issue with 12.1.3.
    Problem extending standard view object with logic on get method
    The 3 VOs that I am having the problem are:
    ViewReceiptsSearchVO
    ViewReceiptsSearchReqVO
    ViewReceiptsSearchSupplierVO
    What do I need to do to get the "Received" column populated?  Please let me know any additional information you want to troubleshoot the issue.
    Thanks.

    Hi,
    Can you Please Share Extended ViewReceiptsSearchVO.xml and .jpx File?
    Thanks,
    Dilip

  • Maintaining data of view objects in cache memory for repeated usage

    Hi,
         We are developing an application which is having around 800 viewobjects that will be used as LOV in different screens. Therefore, it is decided to create a separate project for all such LOV view objects and keep the same in shared scope so that the data can be made availabe across the application.
         The application also communicates with different database schemas based on the logged-in county. For a particular user, LOV view object LovView1 should get the data fetched from Schema1 whereas for user2, the same LovView1 should get the data from Schema2.
         For this, we have created n number of ApplicationModules like AM1, AM2 etc in the project each one being connected to different database. A base application module also has been created and all the county specific AMs extend this base AM. Also all the LOV view object instances are included in this base AM so that they will be available in the county specific AMs also.The entire project is made as an ADF Library jar and this base AM is utilized by other projects for mapping the LOV by attaching the library.
         At runtime, whenever a particular viewobject is accessed, the findViewObject() method of the baseAM has been overridden and the logic is built in such a way to get the logged in user's county code from a session variable and based on the county, the corresponding AM is communicated with and the view object is returned.
         The view objects of the LOV project is used as LOV as well as for doing some other backend processes. In such cases, the view object is obtained and necessary filter conditions are appended to the view criteria and is executed to get the filtered rowset.
    Now, my questions are,
    1. Is it enough to create the jar for the LOVProject and access the view objects from the same baseAM across the application?
    2. I wish to keep all the data in cache memory to avoid repeated DB hits for all the LOV view objects. How it can be achieved? To be more precise, consider two users user1 and user2 logging into the application with different county. When user1 access a LOV viewobject for the first time, data needs to be fetched from the DB, kept in application scoped cache memory and return the rowset. On subsequent calls to the viewobject, the data needs to be retreived from the cache and not from the DB. When user2 also access the same LOV viewobject, the same logic as explained for user1 should happen. How can I achieve this? Actually my doubt is when user2 access, will the data pertaining to user1 remains available in cache? If not, how to make it retain the data in cache?
    3. I also wish to append a particular where condition to a viewobject irrespective of other considerations like logged in county, existing view criteria etc.. How can I do this? A separate thread for this requirement has been posted in the forum Including additional where clause conditions to view criteria dynamically
    Kindly give me your suggessions.
    Thanks in advance.
    Regards.

    Hi Vijay,
    regarding your questions:
    1. What is the difference between "TimesTen In-Memory Database" and
    "In-Memory Database Cache" in terms of features and licensing model?
    ==> Product has just been renamed and integrated better with the Oracle database - Times-Ten == In-Memory-Cache-Database
    2. Is "In-Memory Database Cache" option integrated with Oracle 10g
    installable or a separate installable (i.e. TimesTen installable with only
    cache feature)?
    ==> Seperate Installation
    3. Is "In-Memory Database Cache" option same as that of "TimesTen Cache
    Connect to Oracle" option in TimesTen In-Memory Database?
    ==> Please have a look here: http://www.oracle.com/technology/products/timesten/quickstart/cc_qs_index.html
    This explains the differences.
    4. After integrating "In-Memory Database Cache" option with Oracle 10g, data
    access will happen only through Oracle sqlplus or OCI calls. Am I right here
    in making this statement?
    ==> Please see above mentioned papers
    5. Is it possible to cache the result set of a join query in "In-Memory
    Database Cache"?
    ==> Again ... ;-)
    Kind regards
    Mike

  • Accessing View Object Information from JSP

    Hi!
    I know that my question it's a basic one, but I'm having some problems. Let me start by describing my problem.
    I need to implement an navigation select box to one table (this table will be a result of a query). I'm "building" the select box with a <c:forEach> iterator. Well, the problem starts where:
    <%-- Makes a kind of Math.ceil(double) --%>
    <c:set var="resultInDouble" value="${(binding.estimatedRowCount-1)/binding.rangeSize +1}" />
    <c:set var="resultInDoubleZero" value="${resultInDouble - resultInDouble % 1}"/>
    <fmt:formatNumber value="${resultInDoubleZero}" var="resultInt" pattern="0"/>
    <select name="select" >
    <c:forEach var="SelectBoxItems" begin="1" end="${resultInt}">
    </c:forEach>
    </select>
    As you can see, first I need to calculate the number of "<option> ... </option" I need to put on the select box, and I do that by making an ceil method emulation (for those that doesn't know ceil, it rounds up a division, like 7/3 = 3). To do this ceil I need to call the estimatedRowCount. And that's the problem: when I call estimatedRowCount, the query that I previous made is repeated to calculate the numberOfRows returned. As you can imagine, I don't want to re-execute the query, but only get the number of all rows.
    One solution that I thought, was in the Java Controller File for this page, use the method associated with the ViewObject getRowCount(), that doesn't re-execute the query. With this idea, I would construct the select box with java code, something like this:
    <select name="select" >
    <%
    int ceilResult = Math.ceil(viewObject.getRowCount(),viewObject.getRangeSize());
    for (i = 0;i<ceilResult;i++) {
    %>
    <option> ... </option>
    <% } %>
    </select>
    But with this idea, I hanged with a problem: "How do I in JSP, can "see" the view object?".
    Basically i only need a small example source, that in Java Controller File can get the iterator to make the return of the ViewObject getRowCount method.
    Does anyone have any idea how to solve this problem, or maybe a new approach ?
    Tiago Soares
    P.S. I've already tried some others (attempts of) solutions, but they didn't worked. I didn't posted their description, because I was afraid that anyone would read this post, because of the size of it. :)

    First of all, please stop reposting this question. Post it once and someone will probably reply to it.
    Secondly, you can expose methods of a view object through it's dialog (I think) or you will have to do it in the Application Module.. But it may suit your need better to create a transient column on you VO (one that exists only in memory) and store your value in that.

  • Building tree using view crateria in view objects

    suppose that i have the following tables "class" ,"group" and "item".
    items in table "item" belong to groups in table "group" and groups belong to classes in table "class" .
    suppose there is another table called "selling_basket" that contains an id for the customer and also a foreign key for rows in item table for the items he sold and a "Customer" table that contains customers id and other informations.
    suppose that i want to build an JSF page that contains a table from a view based on the "customer" table and a tree of herarichy - class
    |_group1
    |_item1
    |_item2
    -class2
    |_group2
    |_item3
    |_group3
    and when i click on a row on table customer the tree only display the herarichy for items that this customer sold just.

    i solve the probel the description as follow :
    . the problem : the problem is that when we use the tree model component with the scenario of filtration on the child nodes, we do a normal transactions of steps on the knowledge that the tree will use the master detail behavior as in table component and other ADF Master-details behaviors, so we build two view criteria one on employee and the other on department with the scenario of displaying only the department who has employees with salary equal some certain value, and only shows the employees who has salary equal that value, and on our code we apply the two criteria on the two view objects with the same value we entered to search for , the scenario works well for the top level nodes, but for child nodes it seems it doesn’t work, the behavior make us walk around our selves for why this happened. By debugging options and Tracing what SQL statements that it executes we found that the system execute two statements on the employee view object one with the bind value with the same we inserted and the other with null value, and we notice that the name of the second view object executed is not what we apply the view criteria for(departmentEO_employeeEO_emo_dept_FK_employeeView).
    .The solution: we notice that the tree component doesn’t use master detail behavior as in tables, and instead of that it uses the View link assessors (the run time generated view object departmentEO_employeeEO_emo_dept_FK_employeeView ), to get the detailed items, so we should override the action of the View link assessor.
    To deal with that we generate the view object rowimpl and viewimpl java classes, in the rowimpl class there is a method to call the link assessors with the following code:
    public RowIterator getEmployeesView()
    this.getAttributeInternal(EMPLOYEESVIEW);
    We write our code:
    public RowIterator getEmployeesView()
    System.out.println("Here");
    ViewObject s=((DepartmentsViewImpl)this.getViewObject()).getViewLinks()[0].getDestination();//we get the employee object by using the view link
    // between department and employee
    // then we apply the view criteria to that view object and return it as view link
    System.out.println("row number "+s.getEstimatedRowCount());
    ViewCriteria evc=s.getViewCriteriaManager().getViewCriteria("EmployeesViewCriteria");
    s.ensureVariableManager().setVariableValue("nSal",((DepartmentsViewImpl)this.getViewObject()).getnSal());
    s.applyViewCriteria(evc);
    s.executeQuery();
    return s;
    Notice that we use the employee view object getted by the view link instead of the master details.
    Regards
    Mohammad.b.yaseen
    Sep 26 2011 @ 11:43
    J2EE Team
    RealSoft
    for more info this the application url :
    http://www.4shared.com/file/lgeaYWXa/TreeTestApplication1.html
    notice that i diidn't attach the database with the project so you can connect to the local db
    Edited by: mohammad.j.b.yaseen on Sep 26, 2011 12:13 PM

  • ADF BC connection to SQL Server with parameterized variable for View Object

    Hi everyone
    I'm developing a BPM Application using Oracle BPM 11.1.1.5.0 and JDeveloper 11.1.1.5.0
    Following the thread from the link below, since this is a new topic, I decided to open a new thread.
    Re: ADF method call to fetch data from DB before the initiator page loads
    what I'm trying to do is to get a record from a database and show it to the user on the initiator UI using ADF BC and not the Database Adapter.
    I have been able to work with ADF BC and View Objects to get all the rows and show them to the user in a table.
    However, when I try to run the same query in the parameterized form to just return a single row, I hit a wall.
    In short, My problem is like this:
    I have an Application Module which has an entity object and a view object.
    My database is SQL Server 2008.
    when I try to create a new read only view object to return a single row I face the problem.
    The query I have in the query section of my View Object is like this:
    select *
    from dbo.Employee
    where EmployeeCode= 99which works fine.
    However when I define a bind variable, input_code for example, and change the query to the following it won't validate.
    select *
    from dbo.Employee
    where EmployeeCode= :input_codeIt just keeps saying
    >
    incorrect syntax near ":"
    >
    I don't know if this has to do with my DB not being Oracle or I'm doing something wrong.
    Can someone help me with this problem please?
    thanks in advance

    Hi
    This all seems complicated to me so I think my simplest way would be to use the java code in the aformentioned thread by Sudipto:
    public String getUserLogin() throws WorkflowException,
    BPMIdentityException,
    BPMUnsupportedAttributeException {
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    return userId;
    } I don't know where and how I should put the code to be called when the view object loads though.
    I have created a class in the java class section of my view object which has two methods related to the bind variable input_empCode:
    getinput_empcode and setinput_empcode , as expected.
    however any code i try to put in those two would not be called at all!
    for example:
        public Integer getinput_empCode() {
            //return (Integer)getNamedWhereClauseParam("input_empCode");
            return 1444;
        }and
        public void setinput_empCode(Integer value) {
            //setNamedWhereClauseParam("input_empCode", value);
            setNamedWhereClauseParam("input_empCode", 666);
        }It just keeps filled with the values in the bind variable section.
    I don't know what I'm doing wrong here.
    would you show me the way?
    Thanks again

  • SetWhereClause not working for standard view object

    Hi All,
    We are trying to customize one standard page and for that we have add extra where conditions in the standard view object. In th standard view object query is null which is actually getting executed in vo impl using setQuery as follows:
    Please refer setUpQuery Method:
    Below is the controller code from where it is getting fired:
    if(oapagecontext.getParameter("SearchButton") != null)
                            oapagecontext.putParameter("CurrAction", "SEARCH");
                            validateCategoryCriteria(oapagecontext, oawebbean);
                            SupplierSearchVOImpl suppliersearchvoimpl = (SupplierSearchVOImpl)suppliersearchamimpl.findViewObject("SupplierSearchVO");
                            if(flag)
                                suppliersearchvoimpl.setupQueryForRequestedSupplier(oapagecontext, oawebbean);
                            else
                                suppliersearchvoimpl.setupQuery(oapagecontext, oawebbean);
                            suppliersearchvoimpl.executeQuery();
                            oapagecontext.setForwardURLToCurrentPage(null, true, "S", (byte)99);
                            break label0;
    As in the seeded condition setForwardURLToCurrentPage is getting fired we have added additional where condition in the processRequest of the extended controller as follows:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
    super.processRequest(pageContext, webBean);
        pageContext.writeDiagnostics(this, "inside PR",1);
        OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean).findApplicationModule("SupplierSearchAM");
       // OAViewObject vo = (OAViewObject)am.findViewObject("SupplierSearchVO");
        SupplierSearchVOImpl vo = (SupplierSearchVOImpl)am.findViewObject("SupplierSearchVO");
        //String voQuery = vo.getQuery();
        //pageContext.writeDiagnostics(this, "SupplierSearchVO Query : "+voQuery, 1);
        //String whereClause1 = vo.getWhereClause();
        //pageContext.writeDiagnostics(this, "SupplierSearchVO Where Clause : "+whereClause1, 1);
        //pageContext.writeDiagnostics(this, "vo count "+vo.getRowCount(),1);
        //vo.setWhereClauseParams(null);
         pageContext.writeDiagnostics(this, "sessionVal PR"+pageContext.getSessionValue("sessionVal"),1);
        if (pageContext.getSessionValue("sessionVal")!=null) {
           if(pageContext.getSessionValue("sessionVal").equals("NO")) {
               if(vo!= null){
              // vo.setWhereClause("QRSLT.vendor_id = :2");
              // vo.setWhereClauseParam(1,1486622);
                 //  vo.setWhereClause("vendor_id = 1486622");
                  String voQuery = vo.getQuery();
                  StringBuffer stringbuffer = new StringBuffer(" ");
                      stringbuffer.append("SELECT select_flag,vendor_id,vendor_name,asl_entry,trading_partner_id,\n" +
                          "Po_Hold_Switcher_Col,po_docs_totals,tot_invited_negs,tot_awarded_negs,requested_supplier_id from (");
                      stringbuffer.append(voQuery);
                      stringbuffer.append(") where vendor_id = 1486622" );
                      String str = stringbuffer.toString();
                   vo.setQuery(null);
                   vo.setFullSqlMode(vo.FULLSQL_MODE_AUGMENTATION);
                          pageContext.writeDiagnostics(this, "new query string==>" + str,1);
                   vo.setQuery(str);
                          pageContext.writeDiagnostics(this, "new query after vo==>" + vo.getQuery(),1);
                   pageContext.writeDiagnostics(this, "new query ready toexecute==>" + vo.isPreparedForExecution(),1);
               if(vo.isPreparedForExecution()) {
                   vo.executeQuery();
               else {
                   vo.setPreparedForExecution(true);
                   vo.executeQuery();
                   pageContext.writeDiagnostics(this, "vo count "+vo.getRowCount(),1);
                   pageContext.writeDiagnostics(this, "new query "+vo.getQuery(),1);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext,
    OAWebBean webBean) {
         // sessionVal="No";
          pageContext.putSessionValue("sessionVal","NO");
          pageContext.writeDiagnostics(this, "sessionVal PFR"+pageContext.getSessionValue("sessionVal"),1);    
    super.processFormRequest(pageContext, webBean);
    pageContext.writeDiagnostics(this, "ProcessFormRequest called...", 1);
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean).findApplicationModule("SupplierSearchAM");
    //if (pageContext.getParameter("SearchButton")!=null)
    //  pageContext.writeDiagnostics(this, "inside serach button custom",1);
    //super.processFormRequest(pageContext, webBean);
    //    SupplierSearchVOImpl vo = (SupplierSearchVOImpl)am.findViewObject("SupplierSearchVO");
    //OAViewObject vo = (OAViewObject)am.findViewObject("SupplierSearchVO");
    //String voQuery = vo.getQuery();
    //pageContext.writeDiagnostics(this, "SupplierSearchVO Query : "+voQuery, 1);
    //String whereClause1 = vo.getWhereClause();
    //pageContext.writeDiagnostics(this, "SupplierSearchVO Where Clause : "+whereClause1, 1);
    //pageContext.writeDiagnostics(this, "vo count "+vo.getRowCount(),1);
    //vo.setWhereClauseParams(null);
    //vo.setWhereClause("vendor_id = :1");
    //vo.setWhereClause("city = :2");
    // vo.setWhereClause("vendor_id = :1");
    //vo.setWhereClauseParam(0, "1486622");
    // vo.executeQuery();
      // pageContext.writeDiagnostics(this, "new query after execute ==>" + vo.getQuery(),1);
       // vo.executeQuery();
    //pageContext.writeDiagnostics(this, "vo count "+vo.getRowCount(),1);
    // SupplierSearchAMImpl suppliersearchamimpl = (SupplierSearchAMImpl)pageContext.getApplicationModule(webBean).findApplicationModule("SupplierSearchAM");
    // boolean flag = "PROSPECTIVE".equals(pageContext.getParameter("SupplierStatus"));
      //  if(pageContext.getParameter("SearchButton") != null)
           // pageContext.putParameter("CurrAction", "SEARCH");
           // validateCategoryCriteria(pageContext, webBean);
           // SupplierSearchVOImpl suppliersearchvoimpl = (SupplierSearchVOImpl)am.findViewObject("SupplierSearchVO");
           // if(flag)
           //     suppliersearchvoimpl.setupQueryForRequestedSupplier(pageContext, webBean);
           // else
            //    suppliersearchvoimpl.setupQuery(pageContext, webBean);
            //suppliersearchvoimpl.customExecuteQuery();
           // oapagecontext.setForwardURLToCurrentPage(null, true, "S", (byte)99);
           // break label0;
      We have tried setting both where clause and query but the issue is condition is getting added in the query when I am printing getQuery but while executing it is executing the old vo query only.
    So can anyone help us on this?

    When you post a question, please use the Advanced Editor and paste the code with appropirate syntax. It will make it easy to read. Otherwise your question might get ignored by others as it is very very difficult to read.
    What is the output you are getting for the below diagnostic messages  ? Is it returning the correct query and correct count ?
    pageContext.writeDiagnostics(this, "vo count "+vo.getRowCount(),1);
    pageContext.writeDiagnostics(this, "new query "+vo.getQuery(),1);
    Cheers
    AJ

  • Transient attribute for a view object coming from a socket

    Hello,
    I'd like to create a readonly table (based on a view object without a backing entity).
    Some columns are coming from a table and some other columns (based on the table key) are coming from a socket.
    The problems is that the additional columns are all returned at once by the socket (to avoid calling it for every field and killing our network) and then stored in a java bean.
    So i'd like to make the call to the socket once for every row of the table.
    Do you know in which method of the View object should i make the call (maybe I should do this at the Row level ?)
    Do you have any idea ?
    thank you
    -regards.

    Hi,
    you can try the follwing
    In the bindings of your jspx page you can see iterators defined under "executables". set the "*CacheResults*" property of the specific view object iterator that contains the transient attribute to false.(The default value is true).
    Example:
    <iterator Binds="EditWorkflowNodesView1" RangeSize="25"
    DataControl="AdministratorAppModuleDataControl"
    id="EditWorkflowNodesView1Iterator" CacheResults="false"/>
    Regards,
    Priya.

  • Dynamic View Object Creation and Scope Question

    I'm trying to come up with a way to load up an SQL statement into a view object, execute it, process the results, then keep looping, populating the view object with a new statement, etc. I also need to handle any bad SQL statement and just keep going. I'm running into a problem that is split between the way java scopes objects and the available methods of a view object. Here's some psuedo code:
    while (more queries)
    ViewObject myView = am.createViewObjectFromQueryStmt("myView",query); //fails if previous query was bad
    myView.executeQuery();
    Row myRow = myView.first();
    int rc = myView.getRowCount();
    int x = 1;
    myView.first();
    outStr = "";
    int cc = 0;
    while (x <= rc) //get query output
    Object[] result = myRow.getAttributeValues();
    while (cc < result.length)
    outStr = outStr+result[cc].toString();
    cc = cc+1;
    x = x+1;
    myView.remove();
    catch (Exception sql)
    sql.printStackTrace(); myView.remove(); //won't compile, out of scope
    finally
    myView.remove(); //won't compile, out of scope
    //do something with query output
    Basically, if the queries are all perfect, everything works fine, but if a query fails, I can't execute a myView.remove in an exception handler. Nor can I clean it up in a finally block. The only other way I can think of to handle this would be to re-use the same view object and just change the SQL being passed to it, but there's no methods to set the SQL directly on the view object, only at creation time as a method call from the application module.
    Can anyone offer any suggestions as to how to deal with this?

    I figured this out. You can pass a null name to the createViewObjectFromQueryStmt method, which apparently creates a unqiue name for you. I got around my variable scoping issue by re-thinking my loop logic.

  • Replace default table sort with order by on the view object

    The Jdeveloper help for af:table says:
    If the underlying model is not a CollectionModel , the Table automatically examines the actual data to determine which properties are sortable. Any column that has data that implements java.lang.Comparable is sortable. This automatic support cannot be nearly as efficient as coding sorting directly into a CollectionModel (for instance, by translating the sort into an "ORDER BY" SQL clause), but is sufficient for small data sets.
    I have a database table with varchar2 columns that can contain string, date or number values. So in the af:table I want to sort the columns either in string, date or number order.
    I tried creating a sort listener and in that listener set the view object order by clause and execute the query, but it does not affect the row order - it is always sorted as a string. I assume that the collection is doing its sort after I do the query, and overwriting the query order. I have tried disabling the sort in the listener by setting the sortcriteria to null but it has no effect.
    Can anyone suggest how to stop the default sort re-ordering the rows, or else how to code sorting directly into the CollectionModel as suggested in the help.
    Hugh Nelson

    By running in debug I discovered that when you click on a column heading to sort by the column values it actually sets the order by clause on the view object and executes a query. The help says that the default sorting is not as efficient as setting the order by clause - perhaps the help is out of date because default sorting does set the order by clause.
    This means that you cannot do a column sort on a transient attribute. The attribute being sorted on must exist in the table/query.
    The easiest solution is to override the setOrderByClause method on the view object. The string parameter is the column to order by eg "COLUMNA". If this column holds date values I can change it to something like "TO_CHAR(TO_DATE(COLUMNA,'DD-MON-YYYY'),'YYYYMMDD')". For numbers I do "LPAD(COLUMNA,10,'0')".
    This works OK.
    Hugh Nelson

  • How do I query changed view object attribute in another view object

    Jdeveloper 10.1.3.4
    My requirement is that I want to be able to query a view object (based on entity) on a non-key attribute where the value I am searching on may either be in the database on an existing record or, have just been recorded by updating a different view object based on the same entity (and yet to be committed).
    When querying the second view object for a value just updated via a different view object, the second view object always returns no rows. I had expected the process to be :
    EntityA
    ViewObjectA based on EntityA
    ViewObjectB based on EntityA
    ViewObjectA - query row with key = 123. update attribute Y with value 456 (attribute Y in database null). Entity cache for EntityA, key 123, atttribute Y updated with value 456
    ViewObjectB - query row with attribute = Y. expect record in EntityA cache just updated to be returned. Instead, nothing is returned
    Here is the code I was using (where RandScheduleEdit and RandScheduleSearch are identical view objects based on entity object RandSchedule)
      public static void main(String[] args) {
        String        amDef = "test.cache.model.AppModule";
        String        config = "AppModuleLocal";
        ApplicationModule am = Configuration.createRootApplicationModule(amDef,config);
        ViewObject rsEdit = am.findViewObject("RandScheduleEdit");
        Key rsKey = new Key(new Object[]{40});
        Row[] rsEditRows = rsEdit.findByKey(rsKey,1);
        Row rsEditRow = rsEditRows[0];   
        rsEditRow.setAttribute("SId", new Number(7827));
        ViewObject rsSearch = am.findViewObject("RandScheduleSearch");
        rsSearch.setWhereClause("S_ID = :SId");
        rsSearch.defineNamedWhereClauseParam("SId", null, null);
        rsSearch.setNamedWhereClauseParam("SId",new Number(7827));
        rsSearch.executeQuery();
        Row rsSearchRow = rsSearch.first();
        Configuration.releaseRootApplicationModule(am, true);
      }Why does rsSearch not find the record S_ID = 7827 ? It seems to only be querying new records in the database and ignoring the cached record just updated ?
    Any help greatly appreciated.
    Cheers,
    Brent

    rsSearch.setNamedWhereClauseParam("SId",new Number(7827));This might help:
    rsSearch.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    rsSearch.executeQuery();

  • JDev 10.1.3 EA Studio Edition - View Object Editor java glitch

    Just thought I'd mention what appears to be a glitch - under the "java" section of the View Object editor, the checkbox for generate "Custom Java DataSource Methods" does not appear to function. Selecting it does not add the custom datasource methods in the View Object class.

    Just thought I'd mention what appears to be a glitch - under the "java" section of the View Object editor, the checkbox for generate "Custom Java DataSource Methods" does not appear to function. Selecting it does not add the custom datasource methods in the View Object class.

  • Call view object from ViewController [SOLVED]

    I'm using a valueChangeListener method in a managed bean, which I'd like to use to call a method on a view object. How can I call the view object from a managed bean class?
    Regards

    Maik,
    It is best practice to create a method on your application module, and have this method manipulate VO's and call VO methods.
    See section 8.5.3.1 in ADF Developers Guide for more info o calling an AM method from a managed bean:
    http://download-west.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref673
    Please use the JDeveloper forum in the future for question like this, that are not related to JHeadstart.
    Steven Davelaar,
    Jheadstart team.

  • Modifying where clauses for View Objects in Backing Beans

    In studying the RichTable class I saw no get/set methods that would allow me to manipulate the underlying view instance and rowset for the table in the Backing Bean. I know there is a way to do it, but I having great difficulty in finding it. The tutorials show how to build view objects and display them, but I haven't seen a tutorial that show how to respond to events from the Web page and directly change the data model and what is displayed via the backing bean.
    Can some one point to a tutorial or give me an example on how I can change a view object via a backing bean?

    What you want to do is add a method to your View Object Implementation class that changes the WHERE clause with setWhereClause or addWhereClause. Expose the method to your client. Then call the method from your page by binding it to a commandButton or commandLink. You can bind it through a pageDef file or a backing bean.

Maybe you are looking for

  • File name - When sending a email.

    I am just doing a report.the report fetches some data, do a GR Using a BAPI for each line item. If there are error logs - the logs will be sent to the respective email id which is entered in selection screen. My Question is. 1. Email is working - > b

  • Strange problem with JDBC URL

    Hi All, I don't know whether this is a known issue which has a workaround or I am doing something wrong. But this is the problem. I have a nice GUI application which takes the JDBC URL, Driver, User name and password and then takes the input and trie

  • JMS: limiting message read

    Hi, In our solution, the proxy service reads from the source JMS topic, and query a table based in the request message. Then does the transformation to send the message to target system. In the source JMS topic, at the same time 5000 messages are get

  • AT end of... some issues in using them

    Hi ALL, I am having a req where i have to calculate the no of empty bin for each 3 and 4 row combination.... and each combination will be moved to flat file. so i tried to use AT end of ( field) .... as below:    loop at it_lagp into wa_lagp.       m

  • Oracle Streams and Oracle Apps  11i

    Hi, I am looking for an oracle solution to build a reporting instance off an e-business suite 11i and offload discoverer reporting to the reporting instance. I have tried dataguard logical standby but too many issues and I cannot use. I am wondering