Filtering Transient view objects

Guys,
I have transient view object.
i have populated the rows programatically.
Based on some UI action, i need to filter the rows in the view object. Whenever i filter the rows (using view criteria), i can't get back the lost rows again.
For eg.. i have populated the view object with 5 rows.
Based on View criteria(VC1), i got only 2 rows.
Now i need to apply the same view criteria(VC1) with different values for bind variables, but it applies the criteria on the remaining 2 rows. (but am expecting to apply the criteria on the actual 5 rows)
I think transient view object is loosing rows on applying view criteria.
How this can be solved?

Hi,
can you try using rowmatch
refer following method inside viewobjectimpl
    public void matchByCustomerNumber(String custno) {
        RowMatch rm = new RowMatch("CustNumber = " + custno);
        setRowMatch(rm);
        setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS | ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
        setSortBy("CfMonth DESC");
        executeQuery();
    }you should also see other query modes.
ViewObject
look for QUERY_MODE_SCAN.. contants.
Regards,

Similar Messages

  • How to retrieve the values from a Transient View Object

    Hi Experts,
    I am using Jdevelpoer11.1.1.5.0. I created one Transient view object with attributes EmpId,Salary.
    In Backing Bean i will create rows for that view object and display it in the form of <af:Table> like Empid, Salary and an Update Link.
    Now my problem is i want to update the salary of the particular EmpId. For Example if the EmpId is 100 and salary is 10000 now i want to increase the salary to 20000 and if i click on the update button; i want to retrieve the particular employee details in my backing bean. How can i acheive this?
    Thanks in advance.

    A better approach would be to programmatically populate rows in the <VO>Impl.java by overriding the executeQueryForCollection(0 as specified here -
    http://adfpractice-fedor.blogspot.in/2011/01/adf-bc-programmatically-populated-vo.html
    You can write the logic to update the salary in an AM method then on click of Update or in the getter of Salry field if logic is valid for all fields...

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • How to Create an Input Form using a Transient View Object?

    I would like to use a Transient View Object to store data from input forms across a multiple-page enrollment process.
    My question is how to I create the input form using the Transient View Object on the .jspx page? Do I drag/drop an ADF creation form onto the page? Or, use a regular ADF form? Do I need to create the initial row progammatically?
    Just looking for some general directions or set of instructions? I've looked at the SRDemo example (Globals Transient View Object), but I'm not sure how they created the page at design time?
    thanks

    Well following the SRDemo example, this seems to work:
    1. Create Transient View Object
    2. Add to Application Module as a Data control
    3. Add to .jspx page as an ADF Form (not as an ADF Create Form)
    4. Add following code to Application Module containting Transient VO instance:
    protected void prepareSession(Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getViewObj1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    }

  • Filter transient view object based SOC

    i have a SOC in a popup which is built on a Transient VO in a page on which popup is displayed.
    i need to filter contents of this SOC based on value selected in another SOC.
    both SOCs are based on same transient VO which is denormalized from a relationship point of view.
    transient vo rows are populated programatically.
    what is the best way to filter a transient view object whose rows will be displayed in UI as SOC.
    VO does not have any EO or SQL query defined. only attributes which are populated programatically.

    Hi!
    I encountered the same problem, and found out that each param[] entry is itself an Object[]. So with the following code you can find the contents:
    Object[] bindvar = (Object[])params[0];
    String varName = (String)bindvar[0];
    Object varValue = bindvar[1];Hope this helps,
    Jeroen

  • View Link w/ Transient View Objects

    I'm trying to create 2 view objects that contain only transient attributes and create a view link between them. I have a key defined in the parent and 2 keys in the child. When I create the view link I'm unable to generate the accessor in the source because the boxes are all grey'd out. The destination side works correctly.
    Is there any reason this shouldn't be possibly in BC4J? I've been scouring the documentation and so far I haven't found any mention that a view link will not work in this situation.
    This is in JDev. 9.0.4.
    Thank you

    A view link builds its corresponding where clause based on the selected attributes. On the source side, the attributes are used as parameters to the query, so transient attributes are fine. Attributes on the dest side get built into a where clause which would not work with transient attributes, so they are disabled.
    for example:
    select * from blah where (%1 == destVo.attr1) would not work if destVo.attr1 is transient.

  • How to reset view criteria in transient view object

    Hi,
    I have a view object with one transient attribute:
    ViewCriteria vc = null;
    ViewCriteriaRow vcRow = null;
    ViewObject vo = am.findViewObject("TestView");
    vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    Row newRow1 = vo.createRow();
    newRow1.setAttribute("TestAttr", new Number(10));
    vo.insertRow(newRow1);
    Row newRow2 = vo.createRow();
    newRow2.setAttribute("TestAttr", new Number(20));
    vo.insertRow(newRow2);
    ViewCriteria vc = null;
    ViewCriteriaRow vcRow = null;
    vc = vo.createViewCriteria();
    vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("TestAttr", new Number(10));
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    System.out.println("Rows: "+vo.getEstimatedRowCount());  // Works as expected
    vo.getViewCriteria().resetCriteria();  // This code should reset view criteria
    vc = vo.createViewCriteria();
    vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("TestAttr", new Number(20));
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    System.out.println("Rows: "+vo.getEstimatedRowCount());  // Returns 0 rows - should return 1How to reset and apply view criteria ?

    try to remove the previously view criteria. ie
    ViewObjectImpl vo = this.getSomeViewObject();
    ViewCriteria vc = vo.getViewCriteria("criteria_name");
    vo.removeViewCriteria("criteria_name");
    vc.resetCriteria();
    vo.applyViewCriteria(vc);
    see the link below
    http://adfcodebits.blogspot.com/2010/04/bit-7-reseting-view-criteria-associated.html

  • Transient View Object emptying

    I have created a view object containing nothing but transient attributes, and populate it whilst initiating a page. I can see that information in a table on the page. As soon as I perform an action on that page (<af:commandButton to be precise) all the records vanish and I get a Row currency error.
    It doesn't run the function assigned to the actionListener, it just returns immediately with the error.
    I have specified one attribute as a key, and made sure I passivate transient values. Is there anything else I should be doing to keep these values in place?

    If anyone is interested in the answer to this, it turned out to be because Application Module Pooling had been turned off.

  • Transient View Object based on a RefCursor?

    Hi!
    I have a ViewObject named VO1 which is based on an EO mapped to a db table. Now I have a Transient ViewObject TVO2 which is based on a PL/SQL ref cursor. The example on Steve Muench site is a ViewObject based on an EO but overrides the viewobject framework functions to make it ref cursor based. What I am trying to do is different from the example, so I'm wondering if this is possible?
    I had a viewlink to connect VO1 and TVO2 because the viewlink attribute values from VO1 will be input parameters to the PL/SQL function in TVO2. When I tested this scenario, I get a ClassCastException inside the overriden function
    executeQueryForCollection(...) {
    ... params[0] //when this line executes I get a ClassCastException Ljava.lang.Object...
    super.executeQueryForCollection(...);
    }

    Hi!
    I encountered the same problem, and found out that each param[] entry is itself an Object[]. So with the following code you can find the contents:
    Object[] bindvar = (Object[])params[0];
    String varName = (String)bindvar[0];
    Object varValue = bindvar[1];Hope this helps,
    Jeroen

  • Transient View Object

    Hi,
    I have a Transient VO in which I have two date fields.
    To create a row I am inserting row in VOImpl using this.insertRow(r);
    In case of new row I set only EffectiveDate value with current date and not setting EndDate
    This VO i have dropped on a popup and clicking on Add button popup appears with EffectiveDate filled and EndDate empty.
    Now there is a validation for these dates in VORowImpl class for dates
    if (this.getEndDate() != null){
    if (DataUtil.getDate(this.getEndDate()).before(DataUtil.getDate(this.getEffectiveDate())))
    throw new JboException("End Date should not be less than Effective Date");
    and so getting an error message on popup. Now I click on Cancel button of popup it disappears.
    Now if i click again on Add button popup appears with both Effectivedate and EndDate filled.
    In my transientVOImpl i am deleting allrowsInrange
    Row[] rows = this.getAllRowsInRange();
    for (int count = 0; count < rows.length; count++)
    if (rows[count] != null)
    rows[count].remove();
    and only inserting new row but still getting value filledfor both dates.
    It should not be filled for EndDate.
    Thanks
    Atul

    Hi Atul,
    please use the following property of af:popup
    resetEditableValues="whenCanceled"
    this will reset your popup values every time you click on cancel.
    No need to tell here and there you can direclty ask that popup value are not resetting.
    Regards,
    Vikas

  • Problem with saving Parent - Child  View Objects in ADF 11g.

    Hi Every one,
    I have a requirment, something like I will be displaying some data on my jsff screen based on one Transient View Object. Whenever user clicks on Save button, I have to do following steps in my AMImpl.
    -> Preapre dynamically Parent View Object Rows based on some logic
    -> Prepare dynamically Child View object Rows and invoke insertRow method on respective child view object.
    When I say commit() First Parent ViewObject data need to be saved and then Child View object data has to be saved. I am having Parent - Child Key relation ship btw these two ViewObjects. Some how I am populating the Parent Primary key in the Child View Object. Please suggest me If there is any other alternative to this.
    Thanks

    I got the solution, Enabling the check box option for Master - Detail Entity association (CompositionAssociation -> Cascade Update Key Attributes) resolved the issue.
    Thanks

  • Question on View Object method to use to reset a data entry form?

    I am using a transient View Object form for the purpose of collecting and persisting data entered by users in a set of web data forms that span multiple pages. In the Application Module, I create the first row (see below.) After the user submits the last form, I programmatically add the data to the database (later may change to an Entity Object, but right now I don't use one.) So, the data they entered remains in the VO (it only ever has one row.)
    My question is which method do I use to clear out the current set of data values. I tried VO.clearcache() but it deletes the row, and VO.reset() did not clear the data? If the only way is to delete the row, then please advise the best way to re-create the row or re-set the iterator.
    thanks!
    -- sample code to insert initial row in App Module --
    protected void prepareSession(oracle.jbo.Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getView1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    ---- in service method after user submits the form and row remains in VO, I have tried: --
    vo1.reset(); // does not delete data from the row
    vo1.clearCache(); // deletes the row

    Thanks. Yes this looks more like what I need. How do I call this method from the client-tier, or from within a service method in my Application Module?
    vo1 = findViewObject("myViewObject");
    row = (MyViewRowImpl)vo1.first();
    row.initDefaults();
    compiler error message received:
    Error(279,21): method initDefaults() has protected access in class oracle.jbo.server.ViewRowImpl
    "Customer applications should not access this class on the client-tier of an application. Instead, the Row interface should be used for client tier access"
    Which Row interface method can I call?
    Message was edited by:
    javaX

  • Problem with view object for global variables

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    We are using view object with transient attributes for global variables.
    we defined the view as explained here:
    http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    also we defined one of the attributes as primary key.
    When we start to test our application with disable connection pooling we got some problems.
    sometimes the row in the global view object is deleted.
    (for example after using executeEmptyRowSet on other view object).
    it looks strange, we couldn't fוnd why does it happen.
    Any idea?

    As Timo said, it is very hard to help without source.
    Are you sure that you do the next step:
    After the call to super.prepareSession(), add code to create a new row in the transient view object and insert it into the view object.

  • Triansient view objects vs updatable views...

    In the SRDEMO, they use the transient view objects to create a new request,They never used the eupdatable entity objects in create mode.Can i know the advantages of using transient views over the updatable views...

    There are no real advantages. Transient view objects are one technique to save per-user pending session state that different pages need to see. The create pages could have also been implementing using a straightforward entity-based view object using the Create built-in operation. The demo did it that way since it was the closest ADF BC equivalent to the way that the parallel EJB version of the demo.
    Section 13.6 "Creating an Input Form" of the ADF Developer's Guide for Forms/4GL Developers covers the Create-based way of making an input/create form.

  • Is it possible to un-dirty a View Object?

    I have a transient view object that contains 4 attributes including 2 List of Values.  When selecting from the first List of Values object, the LOV will populate 2 attributes.  Using these 2 attributes will populate the other LOV.  Basically I have a cascading LOV combination.  Now after selecting a value from the last LOV will trigger a change value listener.  This change value listener will do some work in the background i.e., setting a session based object.
    Now everything works fine until I try to navigate through certain parts of the application.  It seems pending changes have been detected and because of this an exception is thrown, which causes the page to refresh but do nothing else.  Is there any way to un-dirty a View Object without having to do a Data Control Rollback Transaction call?

    Thank you for replying.
    Studio Edition Version 11.1.2.4.0
    As for the exception, it doesn't throw one.  I don't see anything in the console. The page just refreshes.  Usually in JSF when the page just refreshes and does not nothing, it sometimes means something bad has happened even though nothing is shown in the console..
    Anyway, I am assuming it's a pending data changes issue because when I explicitly add in the following code via a returnPopupListener:
    if (dataControl.isTransactionModified())
          dataControl.rollbackTransaction();
    everything works again i.e., I can navigate to the different pages.  There are no more page just refreshing issue.
    Excuse me for a stupid question. The View Object was built Programmatic and attributes are defined as transient.   This is what I mean by transient.  I may be incorrect here.  If so, how can I ensure that the View Object is transient?

Maybe you are looking for

  • Free of charge goods.

    Hi All, I have a requirement with free of charge functionality. It  needs to be possible to assign free products retroactively for a certain time period and calculate the number of free products by the number of products ordered in the given period.

  • I cannot print on my Canon MF-4350d after upgrading to Mountain Lion.

    I previously had Snow Leopard and printed on my Canon MF-4350d with no issues.  After Mountain Lion was installed, I get an error message "Failed to read module.  Re-install.: 20600"  I went to the Canon website and downloaded the most current driver

  • Attr change run cannot preceed Data Load?

    Hi, all I need to make attr change run before loading data, because these active MD should be used in data loading routines. When checking this chain BW shows message " A type "Attribute Change Run" process cannot precede process "Execute InfoPackage

  • Slow in opening

    Numbers 3.5 slow when using file/open (10 sec spinning ball). Yosemite 10.10.1, iMac 16 GB RAM

  • Macbook Pro- weak wifi solutions ?

    New Macbook Pro weak wifi ?? I am also experiencing weak & varied signal strength on my Macbook Pro. I recently switched from a Macbook & have noticed side by side that the macbook has better internet connectivity & signal strength. I have thought ab