Jdev 9.0.4 View Object Order By

I'm Using Jdev 9.0.4.
I set Order by in the view object property.
When I'm presenting Data into a table from the View Object it does show with the order by , but when i open it into a drop down combo box it's not set with this order by.
what can i do ?

9040 implements new functionality.
Previously, when a row was created and inserted in a view, this row would only become visible to other views when the changes are posted/comitted. This has now changed. When an execute query is done on a different view, the new rows in the entity cache are visible.
I think the problem stated above is linked to this - The framework is trying to insert a new EO into the VO where the EO is marked as read-only thereby breaking its own rules. In this case i think the View should allow the insert. I dont know the internals, maybe someone from ORACLE could enlighten us??
Thanks.

Similar Messages

  • 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

  • Adding New View Objects/Link on "Preview and Print" - Order Acknowledgement

    Hi,
    Can we add New View Objects/View Links for the existing "Preview and Print" Order Acknowledgement.
    I want to add for the 2 new functionalities i.e., for Charges (from OE_PRICE_ADJUSTMENTS_V ) and the Line Level Notes, which is currently not supported by Oracle.
    Can anyone help me on acheving this functionality?
    Looking forward for your response.
    Thanks in advance,
    Regards,
    Muru

    You can do that. You should first create the new business objects(AM, VO, VL) in jdeveloper, create your new regions in jdeveloper, associate the AM to the top level region(stackLayout) you create. Use personalization and add a stack layout in the Preview and Print page, set the extends property to point to the new region which you had created. Donot forget to deploy all the files in middle tier before doing the personalization.
    The AM which you had added to the stackLayout will automatically be nested with the root AM of the page during runtime.

  • Controlling Post Order of Multiple View Objects

    Hi ,
    Here is the scenario:
    I have a use case of "Creating an Abstract"
    Steps:
    step1 ) (Page 1) Author presents the details of the abstract (Details goes to 2 tables ABSTRACT & ABSTRACT_CONTENT tables). For the 2 tables i have 2 entities. I use a view here called CreateAbstractView from both the tables( here i control the post order of the entities ....code from jdeveloper 11g guide)
    Step 2)(Page 2) Author presents details of Additional Authors. I use the view (*AdditionalAuthorDetailsView*) (Details goes to 2 tables AUTHOR & ABSTRACT). Here in the abstract table i have a parent key(parent abstract id) So all the additional authors has a record in Abstract table with parent_abstract_id from step1. ABSTRACT table also has a foreign key (author_id) .Here also i control the post order of the 2 entity object using the code from jdeveloper 11g guide.
    I also have a link from CreateAbstractView to AdditionalAuthorDetailsView (abstract_id in Abstract table from CreateAbstractView to parent_abstract_id in Abstract table from AdditionalAuthorDetailsView )
    If i have a commit on both the pages , i don't see a problem.
    But i want to have a commit process at the end so that the user can review the information. So when i try to add a commit process at the end , i get a exception (Parent Key not found exception) which i came to understand that commit from AdditionalAuthorDetailsView is happening first which is trying to insert a record into ABSTRACT table and cannot find the parent_abstract_id.
    How do i control the post order for multiple view objects in such scenarios?

    Hi!
    Please take a look at the dev guide. It comes down to controlling the posting order on entity level.
    http://download-uk.oracle.com/docs/html/B25947_01/bcadveo007.htm#CEGJAFCF
    Sascha

  • ER: JDev 10.1.3 needs a different method to verify expert mode view objects

    I am attempting to use ADF against Firebird 1.5. So far I am having great luck, especially in comparison to JDev 10.1.2. However, one thing that does not work is expert mode view objects. The problem is that JDev attempts to validate my query by creating a statement like this...
    SELECT * from (my expert mode query) QRSLT where 1=2
    ...and such a statement is not valid in Firebird. I would recommend that a new method of validation is required when the connection type is "Third Party JDBC Driver."
    Thanks.

    I've filed bug# 5074332 to track getting this looked into. thanks for reporting it.

  • [JDev 10.1.2] Automate Attribute Property assignments in View Objects

    My JHeadstart based application has over 300 tables, and many of these tables have fields that are repeated (e.x. a discontinued checkbox, choice pull downs, and so on...)
    Is there anyway to automate via scripting, a batch job, fancy find & replace, etc. to automatically assign specific attribute properties to specific fields in a project of View Objects?

    Steven Davelaar from the JHeadstart forum directed me back to this forum (as expected), so I am bumping my thread back up.
    Please reconsider my question as it actually a JDeveloper / Oracle ADF question - it has no reliance on JHeadstart.
    Even if I could automate / script the renaming of the fields in a view object it would greatly help my cause.
    Thanks.

  • Jdev 11g AD / View Objects - update and populate web service data contro

    Hi Experts....
    Looking for the best approach here.
    I am hoping that someone can provide me some thoughts / guidance around the best way to achieve populating a webservice data control from a view object.
    Basically I have created an application pulling data from source tables using ADF BC VO's. I am going to put a command button 'Update Record', that will open up a dialog with a web service data control.
    I am hoping to be able to populate the data control fields, with values from the selected record VO.
    I am tipping at this stage, I will need to do this programatically?
    Is this the recommended approach?
    Any examples of code?
    Thanks in advance to anyone that can help!
    Simo

    Should be similar to this:
    http://blogs.oracle.com/shay/2011/03/passing_parameters_between_web.html
    But the first page would get the data from the VO instead of Webservice.
    Since you are using PL/SQL API in the database to do the update, it might be more efficient to just have an AM service method that uses the existing JDBC connection/transaction and calls this PL/SQL stored procedures and passes info from the VO.
    See: http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadvgen.htm#BABEIFAI
    Or taking it even further:
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadveo.htm#sm0328

  • 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.

  • View Object change ok in Jdev but not in Apps

    Hi All,
    I have changed some of the attributes in my page to point to columns in a
    different view object (Which I have amended) . Both of the view object are available to my AM.
    The changes work when run in Jdeveloper but not in APPS. I have reimported
    the page the changed fields are blank, do I also have to import the changed
    view object definitions XML into the MDS repository ?
    Thanks in advance

    You donot need to import ViewObject XMls to the MDs repository, they need to get in to the middle tier(JAVA_TOP). Are you talking about a table or a form layout ? Are you executing the query for the new ViewObject in processRequest, if not they will be blank.

  • 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.

  • ExecuteWithParameter with Binds on several view objects

    I thought I knew how to do this, but it has been a month or two, and can't seem to get the syntax right. I would really appreciate some guidance on this.
    I'm using jdev 11 to create a basic page using ADF Faces. In the model, I have three seperate read only view objects based on queries I created in SQL Developer. I also have two lookup tables for use in LOVs to display names for IDs. In one of the views, I added two LOVs for id columns. I have one more lookup that displays name, id for Tech's.
    All three views have the same named bind variable - :TechID
    What I want is to have a single select box that displays the name column from Tech that will return the ID for TechID. When the user clicks the ExecuteWithParms, all three views should be refreshed and re-queried with the new bind value, and display the results. To see this work, I have been working with readonly tables, but eventually hope to use graphs for the three views.
    Here is the general layout that I am trying to achieve.
    Select One Choice (List of Techs with display set to name, and the return set to ID)
    ExecuteWithParams button. Currenly have table1, table2, table2 in the partialtriggers field.
    table1
    ViewObject1 that has a named bind of :TechID
    table2
    ViewObject2 that has a named bind of :TechID
    table3
    ViewObject3 that has a named bind of :TechID
    This seems like it should be easy to setup. Can this be done declaratively, or do I need code. If I need code, can I get a few hints?
    Is there an example that has something similar that I can gleen how to accomplish this?
    Thanks, Ken

    Timo et al,
    I still can't seem to get this to work. I finally worked through a problem with JDeveloper working (Feels like it has been April 1st for a week straight! (American Humor)). In trying to simplify this, I am asking if someone can create the following example use case based on the HR schema. I'm not asking for a paper, just 15 or so minutes from someone that is good at this to create a working example. Also, send me a zipped copy of the project, or make it available on your blog or other downloadable location.
    Thanks for any help with this to really understand how to get JDeveloper to work for me.
    Here are the specifics for a Highly desired example:
    This is based on HR schema.
    Read Only View Objects
    -- LOCATION_LKUP
    select
    (street_address || ' ' || city || ', ' || state_province || ' ' ||to_char(postal_code) || ' ' || country_id) as location_name,
    location_id
    from
    locations
    order by country_id, location_name;
    -- ViewObject DepartmentStuffView
    select *
    from departments
    where location_id = :LOC_ID;
    -- ViewObject EmployeeStuffView
    select * from employees
    where department_id in (select department_id
    from departments
    where location_id = :LOC_ID);
    -- Modify the AppService and ViewObjects to expose Java code to
    -- modify the (name)Impl.java file
    AppService Code
    public void updateViews(String locationID) {
         // Get a reference to the ViewObjects
    DepartmentStuffView vo1 = (DepartmentStuffView) getDepartmentStuffView1();
    EmployeeStuffView vo2 = (EmployeeStuffView) getEmployeeStuffView1();
         // Now have each view object requery itself with the new parameter
    vo1.updatewithParam(locationID);
    vo2.updatewithParam(locationID);
    ViewObject Code
    -- In both ViewObjects
    -- (DepartmentStuffViewImpl.java and EmployeeStuffViewImpl.java),
    -- add the following code at the bottom
    public void updatewithParam(String locationID) {
         setTechID(locationID);
         executeQuery();
    Layout:
    Location Name: ComboBox <== Displays LOCATION_NAME, Returns LOCAION_ID
    <Run Report> <== Button to run the process
    Table1
    The view object DepartmentmentStuffView
    Table2
    The View Object EmployeeStuffView
    Expected Behavior:
    Change the location in combo box and press the run report button.
    The data in both views with bind variables get updated.
    Extension:
    Page can have search with multiple filters. The AppService can control
    which views get updated with which values depending on selections. Common
    use case.
    Thanks so much, Ken

  • View Objects with Union Queries--trouble with primary keys

    Hi,
    I'm working with JDev 11.1.1.3 and am trying to do a couple of things (without success--yet). I am trying to create a master-detail relationship that displays the existing data in a set of 3 tables and later I will be creating forms for inserting and updating.
    The table structure is like this:
    Table: Member
    Field: MemberIdx (PK)
    Field: Data
    Table: CfgPartner
    Field: MemberIdx (PK)
    Field: DocType (PK)
    Field: DocRevision (PK)
    Field: OtherData
    Table: CfgB2BPartner
    Field: MemberIdx (PK)
    Field: DocType (PK)
    Field: DocRevision (PK)
    Field: B2BData
    I have a View Object for the master table (Member). And I have created a 2nd View Object that is a union of the other two tables. There is some data in CfgPartner that doesn't have a matching record in CfgB2BPartner and vice versa. My thinking is that the two tables are related and I would like them to display within the same table on the ADF page.
    My 2nd View Object has this query:
    SELECT CfgPartner.MEMBERIDX,
    CfgPartner.DOCTYPE,
    CfgPartner.DOCREVISION,
    CfgPartner.OTHERDATA,
    CfgB2bpartner.B2BDATA
    FROM CFG_PARTNER CfgPartner, CFG_B2BPARTNER CfgB2bpartner
    WHERE CfgPartner.MEMBERIDX=CfgB2bpartner.MEMBERIDX(+)
    and CfgPartner.DOCTYPE=CfgB2bpartner.DOCTYPE(+)
    and CfgPartner.DOCREVISION=CfgB2bpartner.DOCREVISION(+)
    UNION
    SELECT CfgB2bpartner.MEMBERIDX AS MEMBERIDX1,
    CfgB2bpartner.DOCTYPE AS DOCTYPE1,
    CfgB2bpartner.DOCREVISION AS DOCREVISION1,
    CfgPartner.OTHERDATA,
    CfgB2bpartner.B2BDATA
    FROM CFG_PARTNER CfgPartner, CFG_B2BPARTNER CfgB2bpartner
    WHERE CfgB2bpartner.MEMBERIDX=CfgPartner.MEMBERIDX(+)
    and CfgB2bpartner.DOCTYPE=CfgPartner.DOCTYPE(+)
    and CfgB2bpartner.DOCREVISION=CfgPartner.DOCREVISION(+)
    ORDER BY MEMBERIDX,DOCTYPE,DOCREVISION
    The query is valid and runs fine in the database. However, the error I'm getting in the app module makes it sound like I don't have my primary keys set up correctly. Here is the error: (oracle.jbo.PersistenceException) JBO-26028: View object testCfgPtnrCfgB2BPtnr does not include a primary key attribute Memberidx of entity base CfgB2bpartner.
    In the View Object it shows the attributes Memberidx, Doctype, Docrevision, Memberidx1, Doctype1, and Docrevision1 all as key attributes. The only strange thing I see is the Entity Usage for Memberidx1, Doctype1, and Docrevision1 are all empty and the info column says "Transient".
    Any help would be appreciated.
    -Steve

    Hi,
    I think that to achieve this you need to suround it with another "select from" statement and create alias for the columns
    I created a test with the departments table (assuming that they are two different tables with different attributes) just to see that it works.
    SELECT DEPID1,DEPID2,DEPNAME1,DEPNAME2
    FROM(
    SELECT Departments1.DEPARTMENT_ID AS DEPID1,
               NULL as DEPID2,
           Departments1.DEPARTMENT_NAME AS DEPNAME1,
              NULL as DEPNAME2
    FROM DEPARTMENTS Departments1
    UNION
    SELECT Departments2.DEPARTMENT_ID AS DEPID2,
              NULL as DEPID1,
           Departments2.DEPARTMENT_NAME AS DEPNAME2,
             NULL as DEPNAME1
    FROM DEPARTMENTS Departments2)The resulting VO will have 4 attributes and you can set the primary key to be (DEPID1,DEPID2)
    If your 2 tables have common columns then these columns can have the same alias
    If you have any problems let me know :)
    Gabriel.

  • Programatically inserting rows of a view object trouble

    Hi,
    I'm using JDev 10.1.3.3. I'm trying to use the application module specific to my app to create rows in a viewobject. User is on page "view", goes to page "new" and fills out a form which upon submit sends the data to an Application Module method I've exposed to the client. What doesn't happen, is when I add the row of the view object programatically in my view object, it doesn't display on the "view" page until a commit is done (when navigating back from the "new" page".
    Here is some sample code of the insert into a composite (not composition) viewobject. When I insert in the new page, it returns to the view page... and the row doesn't show up until commit happens:
    //in my application module
    public void doiIt2(String name, String badge, String item){
    UserItemViewObjRowImpl row = null;
    row = (UserItemViewObjRowImpl)getUserItemViewObj1().createRow();
    row.setBadge(badge);
    row.setBadge1(badge);
    row.setItem(item);
    row.setName(name);
    row.setNewRowState(Row.STATUS_NEW);
    getUserItemViewObj1().insertRow(row);
    getUserItemViewObj1().executeQuery();
    Does anybody know how to get this row to pop in, like using a "creation form" to a table in a view page? What am i doing wrong??? Do I need to do something special in my pagedef of the "view" page?
    Thanks,
    Dan

    Chris,
    Thank you for looking at my problem. The row is not inserted into the table (on the view page) with the code I shared. The criteria for the table's VO is simply a select all, with no where clause, so I don't think I'm excluding it... Upon hitting a commit button, the new row does pop in to the table witch is further evidence that the criteria for the VO isn't excluding the new row.
    I have tried insertRowAtIndex(), even before I posted this with no luck.
    BTW, if I add to the bottom of the code I shared, getDBTransaction().commit; or getDBTransaction().postChanges(), the row does pop into the table when the "view" page is navigated to.
    Am I doing something wrong with my construction of my ViewObject? It is a composition (I got that wrong in my initial post) between two entities. The Item entity is updateable, and not a reference using an association between the two entities on the Badge attribute.
    I am trying to have new composite VO rows always show up as the first item in a table. I've read that the Row.STATUS_NEW will always do this... so I'm trying to avoid posting/committing the new row. I'm also not above inserting at a particular location, but some of the pages I hope to use this pattern with re-execute the VO every time the page is rendered, instead of just rebinding the Iterator with the VO rowsets. I'm being led to believe that if a Row is posted or committed, re-executing the query will resort all rows based on 'order by', etc.
    Also, I have setup a similar yet even more complicated example using three entities. I was able to make this work as expected. The difference is that I was using an ADF Creation Form. ( I did have some work in the model to make all the keys line up though.... posting order... etc.).
    I have gotten similar things like this to work with single entities VOs. I'm just having trouble when I do composite VOs. That is supported, isn't it?
    Dan

  • ADF BC merge records of 2 view objects into third

    jdev 11.1.1.4
    Hi,
    1) how to merge records of 2 view objects into third view object?
    2) how to search inside view object whether the record already exists?
    I want to do this in AMImpl programmatically.

    hi I find that I can use something as below but it will check for each row at a time.
    String exp = "student_id=" + "'" + studentId.getValue() + "'" + " and " +
    "pass_word=" + "'" + password.getValue() + "'";
    vo.setWhereClause(exp);
    so if there are 10 records(to compare) i have to loop it 10 times(with company id and order id in exp) which i will be getting from some view.
    and have to execute query 10 times so i don't think this is a efficient approach.

  • Dinamically sorting child view object

    Hi
    i have a master-child relationship between 2 view objects displayed in jsff as master form - detail table fashion.
    By default, child is ordered by, for eg.,  attr1.
    There is a button that opens popup with child records which need to be ordered by another attribute (attr2).
    Basically, child view object should be ordered one way when displayed in jsff, and on the other way when displayed in popup.
    What is a best practice to deal with this kind of requirement?
    JDev 11.1.2.3
    Thanks

    Hi,
    You can generate the VOImpl for the ViewObject and create a method, which would take the order by clause. Expose this as client interface and then you can pass respective column name to order by dynamically and execute the method before opening the popup.
    Ex :
        public void setOrderBy(String orderBy){
            this.setOrderByClause(orderBy);
            this.executeQuery();
    -Arun

Maybe you are looking for

  • IPod Touch 4G won't turn on

    I got a serious problem now. Right now, I think my iPod is dead and I might take it to an Apple Store. Here are the signs I'm getting: Black screen like it's locked or turned off, even in recovery mode. iTunes won't detect it unless in recovery mode/

  • Not able to edit  text or place any hyperlink in navigation menu in Muse

    I am not able to select/edit text in navigation menu also not able to apply any hyperlink on the text or tabs. It is not letting me do that.  I don't see any hyperlink option even when I select the tab. Is it some kind of bug? I made two sites with A

  • Java stopped working

    I have some Java sources that I have compiled into classes. They have been working fine for the past 6 months. Today suddenly Java is giving an error in thread main of java.lang.NoCLassDefFoundError, which is the same error it gives if there is no cl

  • Extract Pages

    I could have sworn you could extract pages from a PDF using just Reader. I've got Reader 8 and I don't see that option to extract pages. Is it really only available in the full version?

  • Set up a group list in e.mail ???

    How can I set up a "group list" (in my e.mail) in my 4s like I have on my big Mac?  When I want to send a message to a large group of friends?