Enhancement to ADF ViewObjects

An Additional enhancement request regarding ADF/BC4J.
i would like to have ViewObjects that has INSERT MODE and QUERY MODE similar to Oracle Forms.
When an Orcale Form is launched, a default new blank record is displayed on the screen and the only time data is fetched from the database is when u enter query mode and then execute the query. And that is using only one Datablock.
In Oracle ADF/JSF, we can replicate that by setting the ViewObject maxfetchsize to zero upon creation of the ViewObject object. When the page associated with the viewObject launches, I will just execute a CreateInsert on pageLoad (invokeAction). To enter Query mode, I will have a backing Bean action that resets the maxfetch size to a positive number and then execute the query.
Then I override the ViewObject's executeQuery() method so that after calling "super.executeQuery()", is will reset the fetch size again to zero.
Now, my request is if the ViewObject can have this functionality BUILT-IN so that I won't have to create a custom backing bean action.
regards,
Anton

Hi,
I created bug 6066516 as an ER
thanks
Frank

Similar Messages

  • ADF ViewObject Clarifications

    Hello,
    I'm facing strange behaviours in ADF viewobject. I have a viewobject PropertyView1. I need to list the properties only for a particular user. And also within that , I need to display based on the property status.
    So I have a dataaction (DA1) which binds to a app module function ,
    ViewObject vo = getPropertyView1();
    vo.setWhereClause(" Property.USERID = :1 ");
    vo.setWhereClauseParam(0,new Long(uid));
    vo.executeQuery();
    This sets the view object to display only the properties of a particular user. This DA1 forwards to a datapage (DP1) on "Success", The DP1 contains the ADF Read-Only table for the propertyview1 view instance.
    I have another function which should display only the "new" properties for a particular user.
    Another data action (DA2) which contains the function,
    ViewObject vo = getPropertyView1();
    vo.setWhereClause(" Property.PROPSTATUS = :1 and Property.LAGENT = :2 ");
    vo.setWhereClauseParam(0,status1);
    vo.setWhereClauseParam(1,new Integer(uid));
    vo.executeQuery();
    This displays the user properties which are "New". Similar to the first data action, DA2 -> DP2 on success.
    The following Sequence of actions gives strange behaviours every time,
    1. Execute the first dataaction (DA1) . It works properly , Provides me with correct list of properties.
    2. Execute Second dataaction (DA2). There are no rows which match the criteria. So I get "No Records Found" in Dp2.
    3. execute first data action again, It provides me No records found as well as Errors.
    The errors are,
    " Bind variable does'nt exist"
    Somehow there are two bind parameters set for DA1, while there is only one bind parameter in my where clause. And this happens only on the second time. I'm able to ececute DA1 correctly on the first time.
    Also, Pelase let me know if I Have two create two view instances for these types of queries. Or Is there a way to revert back to all the rows originally in the propertyview1 view object (The view object has no where clauses in the definition), after executing the DA2 or DA1 dataction. I hope i was clear in the above questions.
    Thanks a lot.

    Just a guess: call vo.setWhereClauseParams(null) before setting new parameters.
    From the VO API Doc:
    Note that calling setWhereClause() does not clear the previous settings of WHERE clause parameters. To reset WHERE clause parameters in the middle tier, call ViewObjectImpl.setWhereClauseParams(Object[]) explicitly with a null value. For example:
    vo.setWhereClauseParams(null);

  • ADF - ViewObject (with Bind Variable) Bind to Table- JDeveloper 10.1.3 EA

    Hi all,
    1.- This is the situation:
    In JDeveloper 10g 10.1.3 EA I have two JSP JSF Pages with bind automatically coponents (backing bean).
    - In the first page I can select a value from a list. Then, when I press the "Accept" ADF Command Button, the selected value is stored in a property called "rutEntidad" of a Session Managed Bean and the Flow Control is passed to the second page.
    - In the second page I have an ADF Table (called tablePolizas) bind to a ViewObject (I drop the ViewObject from the Data Control Palette to the Page - ADF Read-Only Table ). The ViewObject has a Bind Variable called RUT_ENTIDAD. When this page is loaded, value in the rutEntidad property of Session Managed Bean is passed to the ViewObject in order the ADF Table show filtered data . Also in this page there is a "back" ADF Command Button to the first page. The filter mechanism is performed in the getTablePolizas method in the backing bean of the second page, like this:
    //**** The backing bean of the second page *****
    package cl.bicevida.view.backing;
    public class CrearUsuario {
    private CoreTable tablePolizas;
    public CoreTable getTablePolizas() {
    DCBindingContainer dcbc;
    DCControlBinding cb;
    String rutEntidad;
    FacesContext ctx =FacesContext.getCurrentInstance();
    ValueBinding vb =
    ctx.getApplication().createValueBinding("#{SessionManager.rutEntidad}");
    rutEntidad = vb.getValue(ctx).toString();
    dcbc = this.getBindingContainer();
    cb = dcbc.findCtrlBinding("VoPolizasAsociadasEntidadExterna1");
    ViewObject vo = cb.getViewObject();
    vo.setNamedWhereClauseParam("RUT_ENTIDAD", rutEntidad);
    vo.executeQuery();
    return tablePolizas;
    2.- And this is the problem:
    The first time all works fine... then I press the "back" ADF Command Button to the first page (and NOT the back button of the browser). The second time, if the numbers of rows returned by the ViewObject is different than the first time, the application throws this message (but not crash):
    validation - JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    validation - JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    Well, I had read the "Generic Approach for Back-Button-Friendly Web Rowset Paging" article of Steve Muench in http://www.oracle.com/technology/products/jdev/tips/muench/paging/index.html
    but I think here have another problem.
    3.- The questions:
    Which is the cause of this problem?
    How I can solve it?
    What another way I can programmatic pass a parameter to a ViewObject connected to a table?
    Thanks!!!

    Another thing: the used strategy to obtain a binding container is explained by Steve Muench http://www.oracle.com/technology/products/jdev/tips/muench/1013eabinding/index.html:
    Next, you can use JDeveloper's Overview tab of the faces-config.xml file editor to configure a managed property. Define the managed property name as bindingContainer to match the property in your bean, and set the class to the fully-qualified name of the DCBindingContainer class. You can use the (Browse...) button to quickly locate the class using the new JDeveloper 10.1.3 class browser. Just type in the first few letters of the DCBindingContainer name, and then select the class. Edit the new managed property and set its Value to the JSF EL expression: #{bindings}.
    ************************

  • Format values: DB View or anything in ADF ViewObject?

    Hi.
    I have a DB table with a field called PERSON_ID, which is the ID of one person.My JDeveloper version is 11.1.1.7.0
    With an Oracle funcion in DB, I pass this ID and get Mr. John Smith Smith ready to show in the application.
    Other field in the table is AGE, with a raw simple number.
    I need to generate an ADF table, and I need to show the formatted person name and his/her age.
    I have tried these two approaches to get the solution:
    Generate a calculated attribute in the ViewObject, and try to invoke the DB function: obviosly, if this was possible, I did something wrong, because it didn't work. If something like this was possible, it would be the best solution.
    DB View: This works, but I can't commit data in this application window.
    Create a DB View with formatted name, age, etc.
    Map it in an EO and VO
    Generate an ADF table from this VO
    When the above form is filled, insert the form data in DB Table.
    Commit the new row
    Reload the ADF table.
    How can I solve this issue?
    Any suggestion is very appreciated
    Thanks in advance. Regards

    . I have tried these two approaches to get the solution:
    Generate a calculated attribute in the ViewObject, and try to invoke the DB function: obviosly, if this was possible, I did something wrong, because it didn't work. If something like this was possible, it would be the best solution.
    Did you follow this: http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcquerying.htm#CHDHJHBI
    What you mean by "it didn't work"? Is there any error?
    Another approach is to change query mode from normal to expert and directly add new column to sql query, but in this case you will need to manually synchronize attribute list and sql query every time when you modify columns in your view object(for example, when you add new column to table)
    DB View: This works, but I can't commit data in this application window.
    Event that is possible, but you need to define "instead of" trigger in db and modify lock() method in EntityImpl class, so this is overkill for your usecase.
    Dario

  • Enhance Req: ADF BC Assoc and Link editor

    Hi JDev team
    I'd like to raise the following enhancement requests please for JDev 11g TP.
    For both the ADF BC Association and Link editor, to view the Relationship you need to click on the Relationship category. Seems to me 9 times out of 10 when you access these objects you want to see the relationship. I'd suggest the Relationship information needs to be under the General category as part of the default view.
    Can you raise an enhancement request for this please.
    Also, for the Association editor, to view the properties of the association, you need to click on the Relationship category, Accessors editor button, and then in the Association Properties dialog you see the association properties (eg. Implement Cascade Delete etc). This seems unnecessarily hidden too deeply.
    Can you raise an enhancement request to promote these options to the editor rather than in this dialog please.
    Thanks & regards,
    CM.

    Filed ER for the first one (#6121857)
    The 2nd one has already been implemented post-JavaOne Tech Preview. There is a "Behavior" section on the Relationship panel now with those options accessible.

  • ADF ViewObject scolding me.

    Hi,
    I have created a ViewObject through ADF Business Objects which contains 3 fields(code,name,mail) all are updatable.
    In the query part I am using a where clause
    select code,name from table_name
    where employee_email = :1
    order by name
    In my action class I am passing value to :1 like
    vo = am.getXXXXQuery();
    vo.setWhereClauseParam(0,userId);
    System.out.println(vo.getQuery()); ---> displays the preceeding query where employee_email = :1
    its not getting the value for :1.
    My ViewObject contains some row implementation class, do I have to pass the value here?
    protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception
    switch (index)
    case CODE:
    return getCode();
    case NAME:
    return getName();
    case EMAIL:
    return getEmail();
    default:
    return super.getAttrInvokeAccessor(index, attrDef);
    * setAttrInvokeAccessor: generated method. Do not modify.
    protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception
    switch (index)
    case CODE:
    setCode((String)value);
    return;
    case NAME:
    setName((String)value);
    return;
    case EMAIL:
    setEmail((String)value);
    return;
    default:
    super.setAttrInvokeAccessor(index, value, attrDef);
    return;
    Plss help me.
    Thanks,Vicky

    Hi Vicky,
    first of all you should post your question in the JDeveloper forum (JDeveloper and ADF
    The answer to you question is simple. vo.getQuery() returns the query text as is (without any bounded parameters). The values for the parameters are bound automatically when you do vo.exceuteQuery(). You have nothing else to do, just call executeQuery().
    Timo

  • Enhance Req: ADF BC create java classes

    Hi JDev team
    Can you log the following enhancement request please under JDev 11g TP.
    In any of the ADF BC editors under their Java options, when you select to generate a class for the selected ADF BC object (eg. EntityImpl for an EO), it would be preferred the newly generated class file was opened in the editor. At the moment you have to then find the newly generated file under the ADF BC object in the Application Navigator and open it separately. I'd suggest 9 times out of 10 when you've just created a Java file for an ADF BC object, you'd want to edit it straight away so it should auto open.
    Regards,
    CM.

    Chris,
    filed a Er with lower piority to make this an option in teh JDeveloper prefrences settings for ADF BC. ER 6121517
    Frank

  • Selecting unique rows in ADF ViewObject

    Hi,
    In my ADF application, i am fetching data from a table. the situation is, my table is having same row of data multiple times. The primary key is a sequence. I want to fetch distinct rows of data from the table.
    So, I wrote query to fetch the distinct rows of the table.
    The query works in the Database SQL worksheet, but when i use it in my ViewObject and run, it throws an error saying
    View object ActiveUsersVO does not include a primary key attribute Pk of entity base ExtUserMapping.here Pk is my primary key. I did not used it in the query to get the unique rows.
    help me fetch the unique rows in ADF without the primary key
    thanks,
    Rajan

    User please tell us yor jdev version!
    This should be no problem as long as your VO is build as road only based on a query like
    select distinct department_id from job_historyThis VO can be used without a PK, however some function which are working on PKs won't work. The query works on hte HR schema.
    Timo

  • Enhance Req: ADF BC domains

    Hi JDev team
    Can you raise the following enhancement request for JDev please?
    For domains, it's possible to create a validation rules that validates any attribute based on the custom domain. This is great for when the user inserts/updates an EO/VO attribute to ensure the particular attribute matches (for example) a regular expression or similar.
    However for existing legacy data that is pulled from the database, the domain validation also fires causing any data that doesn't meet the validation rule to be rejected and not show. This implies that you can never use custom validation domains for legacy system columns where the data doesn't comply.
    Can you raise an enhancement request to include an option with custom validation domains to only validate the data if it is inserted/updated by the user, not for existing data please? This means we could use the advantages of domains for new and old data alike.
    Regards,
    CM.

    Chris,
    I filed ER 6121502
    Frank

  • Enhancement request: ADF BC property sets

    Hi JDev team
    "Yeehaw" on the property sets feature. Very Oracle Designer like.
    To make them even more powerful can you:
    1) In the App Navigator provide "analyze dependencies" option on the right mouse sub-menu.
    2) In the ADF BC EO/VO attr document view, and attribute editor, can you show any values derived from the property set, and show them in a different colour.
    3) If a custom value is given for an ADF BC EO/VO attr property, over-writing derived property set value, facility to change back to property set value, and/or set null.
    4) The ability to create a new property set from an existing ADF BC EO/VO attribute
    5) Ability to set property sets against ADF BC VO bind variables
    Thanks,
    CM.

    1) We plan a "Find Usages..." option on ADFBC components, including Property Sets
    2) Filed ER# 6053438
    3) Filed ER# 6053447
    4) Filed ER# 6053454
    5) Filed ER# 6053457
    Thanks.

  • Enhancement request - ADF BC convert EO based VO to read-only VO

    Hi
    Can't see if we can do the following in 11g (or 10.1.3); is it possible? Otherwise would be a nice to have.
    If at design time I mistakenly create an ADF BC VO as one that is based on an EO (ie. updateable VO), but it would be better suited to a read-only VO (for the documented runtime efficiencies), a tool to convert the updateable VO to a read-only VO without losing the attributes and SQL query settings would be great. Ideally a right mouse click option on the VO or via the VO document window as an option.
    Cheers,
    CM.

    I've filed Enh. Req. # 6040888 for tracking.
    You should be able to copy the existing query to the clipboard, remove the entities, then paste in the query again.
    Numerous new runtime features in 11g depend on having an EO-based view object, and the runtime overhead is not large, so in practice our internal best practice for our own Oracle Applications development teams will be to use entity-based VO's most of the time going forward.
    It's true there is a small amount of overhead still, and view objects used for SQL-based validation purposes will still be good candidates (as well as view objects that don't want to see the pending changes in the entity cache for some application-specific reason).

  • ADF View object validation. Cannot have same column value multiple time.

    Hi Expert,
    I have a ADF viewobject validation question. I have the Department and employee view objects. Each department have multiple employees. (may be u can also assume. the employee name is an VO attribute not the database field)
    I need to implement the following validation rule
    One department shouldn't have same employee name. How can i implement this validation rule in the ADF-BC.
    Looking forward ur expert suggestions. Thanks
    -t

    Assuming that the employee name (which you have said is a transient attribute) is created by concatenating some other fields, you could, I suppose create a unique index in the DB or a unique validator in the EO to ensure that the department ID (assume you have such an attribute) and the fields that make up the name are unique. It seems kind of unusual to be validating a transient field like this.
    John

  • How To: Use ADF Form in "Insert" Mode in jDeveloper 12c

    Hi all,
    I'm in the process of learning jDeveloper and after going through the basics, a task that I'm trying to accomplish is to have a ADF Form load in "Insert" mode rather than the default "Update" behavior. After significant searches, the closest that I could come to was Create-adf-input-form post. But since that tutorial is based on the 11g version, I'm struggling to find an equivalent of that in 12c.
    Can anyone point me in the right directly and help me in determining how I would achieve the same in 12c?
    Thanks,
    Nisar

    Nisar,
    If you want the newRow to be readily available when the page loads, you call vo.createRow() in a AM method and expose that method as a client interface. Call this method on the page load.
    The below links might help to call method on page load:
    Johny's Tips: ADF: How to execute the ViewObject with a ViewCriteria on the PageLoad in ADF Web Application
    https://blogs.oracle.com/aramamoo/entry/an_epic_question_how_to
    This link helps to know how to create VO row programatically.
    http://www.awasthiashish.com/2012/12/insert-new-row-in-adf-viewobject.html
    Let us know if you face any issue while implementing.
    Cheers
    AJ

  • Adf table filter

    adf filterable table
    filter works only on numeric columns ,on text columns "No data...."

    I created a simple test application in JDev/ADF 11.1.1.6 and I can confirm the problem you encountered. My test application is very simple. It consists of a single ADF Faces page containing a read-only <af:table> with a filter. The <af:table> is based on an ADF ViewObject on a MySQL 5.5 DB table containing two varchar columns.
    The problem happens when a MySQL DB is used and it is related to the MySQL's SQL syntax. The problem is caused by a wrong WHERE-clause criterion generated by ADF when the user enters some condition in a filter field backed by a DB column of character datatype. ADF generates a WHERE-clause similar to this one:
    WHERE MyTable.col1 LIKE ( ? || '%' )This would be a correct WHERE-clause for many SQL-databases, but it is not correct for MySQL, because in MySQL the operator || does not perform a string concatenation but it acts as a logical OR. In this way the expression <tt>( ? || '%' )</tt> is not evaluated to a string but to a boolean value (e.g. 0 or 1), so the operator LIKE fails to filter the rows correctly.
    You can inspect the generated SQL-query and the values of the bind variables yourself by switching ADF diagnostics on (e.g. set -Djbo.debugoutput=console to the runtime configuration of your ViewController project).
    JDeveloper/ADF 11.1.1.6 certification matrix says that MySQL 5.5 is certified for both JDeveloper IDE and ADF, so in my opinion you can submit an official SR if you have a valid support contract which covers Oracle ADF.
    A good workaround would be to implement a custom SQLBuilder or a custom ViewCriteria adapter that patches the problem, but it would require a lot of efforts. Alternatively, you can try to implement a tricky workaround by subclassing the ViewObjectImpl class and overriding some of its query-related methods in order to replace the substring <tt>LIKE ( ? || '%')</tt> with <tt>LIKE CONCAT( ?, '%' )</tt> in the generated SQL query. This is tricky, so I do not recommend you this way either.
    However, if you decide to follow the later alternative, you can override both methods <tt>ViewObjectImpl.buildQuery(...)</tt> in a custom base ViewObjectImpl class (or in a custom ViewObjectImpl class of particular VOs only) as follows:
      @Override
      protected String buildQuery(int noUserParams, boolean forRowCount)
        String query = super.buildQuery(noUserParams, forRowCount);
        if (query!=null) {
          query = query.replace( "LIKE ( ? || '%')", "LIKE CONCAT( ?, '%' )");
        return query;
      @Override
      protected String buildQuery(int noUserParams, boolean forRowCount, String selClause, String fromClause, String whereClause, int subQueryLevel)
        String query = super.buildQuery(noUserParams, forRowCount, selClause, fromClause, whereClause, subQueryLevel);
        if (query!=null) {
          query = query.replace( "LIKE ( ? || '%')", "LIKE CONCAT( ?, '%' )");
        return query;
      }Dimitar
    Edited by: Dimitar Dimitrov on Feb 2, 2013 12:07 PM

  • Adf Readonly table to Editable

    Hi All
    I am using JDev 9.0.5.2. I need an editable table from an adf viewobject. Here is what I do:
    1. I create a view.
    2. On my jsp page I drag a readonly table from my data controls onto the page. There is no editable table option in this version of Jdev.
    3.I drag a create button onto the jsp page.
    Problem
    When I hit create, nothing happens.
    I go to the Ui Model to have a look at the action for the create button and its action is set to create. There are a list of other actions that can be assigned to this button but there is no insert or new action.
    Can anyone help with this
    Thanks

    Hi,
    open the Create action and set it to CreateInsert to create a new record. Note that you have to navigate to a page that has an editable form based on the VO
    Frank

Maybe you are looking for

  • Bitlocker to Go and deleted computer object

    When encrypting a USB drive using Bitlocker to Go and storing the recovery information in AD, where does it get stored?  Is it in the computer object like regular Bitlocker?  If so, if the computer is retired or the AD computer account is deleted, do

  • Rotate object based on the mouse movement

    Hi, how can I do to make the object rotate based on the direction and movement of the mouse? Similar to this: http://activeden.net/item/billboard-style-xml-photo-viewer/22111 Thanks in advanced.

  • Didn't download, but got a malware email

    I just got the NACHAm "Your payment has been rejected and read the .exe attachment" Zeus malware email today (it's been floating around since 2009). I don't have Windows or any window apps on my Mac, and am running 10.6.8. As soon as I saw this I had

  • Folder Issue

    All, since having Verizon DSL installed on her PC, every time my mom tuns on her computer, the Verizon folder in the Program Files folder always opens up maximized.  How can she prevent this from happening?

  • My Macbook crashed yesterday, with After Effects on it. I bought a new one, but how can i re-install After Effects, without buying it again?

    My Macbook crashed yesterday, with After Effects on it. I bought a new one, but how can i re-install After Effects, without buying it again? I logged in to my creative cloud-account, but i can't find the program or the order of the program in my hist