App module view object row currency and task flows

Hello -
Using JDev 11gR1. My application uses ADF Rich Faces with ADFBC.
I have case where I want to
a. select a row in a table based on a view object
b. hit a button to invoke a method in an application module.
c. in the app mod method, call getMyViewObject().getCurrentRow() to get the row selected by the user
d. "do something" with the row
In 10.1.3, this worked fine.
In 11gR1, I am having problems:
1. The above situation works fine if I have a regular page.
HOWEVER,
2. The above situation does NOT work if my table is in a page fragment in a task flow. (The getCurrentRow() returns NULL.)
For case #2 I've checked the following:
* verified that the selectedRowKeys and selectionListener attributes were set on the table in the page
* verified that I'm using the correct app module instance (I have nested application modules).
* experimented w/various transaction and data control scope settings in the task flow definition.
So... from those details is there something obvious I am doing wrong? It looks like cases #1 and #2 above use different row set iterators. Is there a way to grab the correct row set from within my app module method? Does this have something to do with the data control scope defined by the task flow? (For 11g do I need to "rethink" sticking logic in the app module and instead placing it within a managed bean get access to my ADFBC objects via the bindings layer?)
Thank you for reading my question,
-- Scott

See this article for View Object tuning tips:
http://www.oracle.com/technology/products/jdev/tips/muench/voperftips/index.html
Are you planning to use this AM as a nested AM inside other application modules?
If you don't the "selection AM" will have its own, separate database connection/transaction.
If you do, it will share connection, transaction with its containing "root" AM.
It may not be relevant to your application, but just realize (which is explained in the article I point to above) that view objects that are not related to entity objects do not "see" pending changes in the current transaction. That feature depends on the VO/EO cooperation. It's fine to build VO's without an EO -- in fact we've made it easier to do this in 10.1.2 in the Design Time wizards -- but you just want to make sure you realize what features it's giving up. If you don't need those EO-related features, then by all means create an Expert Mode VO that's not related to EO's.

Similar Messages

  • Separate App Module, View Object based on Select not EO: Best practice?

    Hi,
    I have a list of base tables(parameters) that are used everywhere in my application for selection components (List, Combo, Radio).
    I'm considering creating a separate app module with a view object based on query for each table.
    I have created a BaseTableAM application module for managing those tables, Entity objects and View Objects in update mode.
    Those tables are rarely changed.
    Example of table:
    ItemType
    item_type_id = primary key
    name = description
    In the BasetableAM:
    ItemTypeEO entity object
    ItemTypeVO updateable view object based on related entity object.
    Now in my project I will create combo boxes for selection of the item_type_id.
    Separate application module:
    SelectionViewAM composed of View Objects based on Select statements and not on Entity Objects.
    Example of view object ItemTypeViewVO:
    SELECT ItemType.ITEM_TYPE_ID,
    ItemType.NAME
    FROM ITEM_TYPE ItemType
    All view objects in this application module will be read-only and for selection only.
    By basing all those View Objects on select statements not based on Entity Objects I suppose there will be no locking and "value changed" management => less overhead.
    Is this a good practice?
    Being read-only I could have based those View Object on Entity Object with flag updateable set to no, what would you recommend?
    By creating a separate Application Module for those selection view objects, I know that update will not be possible.
    Thank you for your advice.
    Frederic

    See this article for View Object tuning tips:
    http://www.oracle.com/technology/products/jdev/tips/muench/voperftips/index.html
    Are you planning to use this AM as a nested AM inside other application modules?
    If you don't the "selection AM" will have its own, separate database connection/transaction.
    If you do, it will share connection, transaction with its containing "root" AM.
    It may not be relevant to your application, but just realize (which is explained in the article I point to above) that view objects that are not related to entity objects do not "see" pending changes in the current transaction. That feature depends on the VO/EO cooperation. It's fine to build VO's without an EO -- in fact we've made it easier to do this in 10.1.2 in the Design Time wizards -- but you just want to make sure you realize what features it's giving up. If you don't need those EO-related features, then by all means create an Expert Mode VO that's not related to EO's.

  • View object Rows

    Hi,
    I am extending an OAF page. In which I am trying to get access to all the rows of a view object. This view object is used in an advance table. The advance table shows me 15 rows. 10 rows at a time(Advance table functionality).
    Now when I write this code, it return me 15 as a result.
    String.valueOf(vo.getRowCount()But when I try to run this code to iterate to each and every row, it just returns me 10 rows.
    AwardLineVOImpl vo = (AwardLineVOImpl)am.findViewObject("AwardLineVO");
    AwardLineVORow vorow = (AwardLineVORow)vo.getCurrentRow();
         while(vo.hasNext()){
            vorow = (AwardLineVORow)vo.next();
            oapagecontext.putDialogMessage(new OAException(vorow.getBidNumber()));
         }I want to know how can I get access to all the rows in the view object. As I can see the advance table shows 10 rows at a time. And when you click next, the next 10 rows are shown.
    Regards,
    B

    The "row state" is only meant for entity object rows, not for view object rows.
    For further details and a possible solution, please check How to identify inserted/modified row(s) in a VO
    (Not related) Mr. "73012", I noticed you posted lots of answers on this forum lately. Nice of you that you want to help, but much too often (IMHO) you are not explicit enough to provide a useful solution. Or, sometimes, not quite attentive to the question...
    If you are an Oracle employee, please take a bit more time to read the question; and maybe make your name public... If not, the same ;)
    Thanks,
    Adrian

  • How to reset View Object row state to Unmodified

    Hi,
    My requirement is as follows. In my home page, I have a table listing master records with links to a master detail page. In this master detail page, the master is displayed in a form, and details in an editable table. There is also a button that is used to "Add 5 New Detail Rows". User will use this button to add multiple new detail records for insertion.
    Anyway, when user visits this master detail page, I should also programmatically add 5 new detail rows. For this, I define a custom method in the master view object class (called add5MoreRows()...see below), define the binding to this custom method and add invokeAction executable in the page definition.
    public void add5MoreRows() {
    DlistHdrVORowImpl row = (DlistHdrVORowImpl) getCurrentRow();
    createMoreLineDetailRows(row, 5);
    // Need to reset the master row state to Unmodified
    public void createMoreLineDetailRows(DlistHdrVORowImpl row, int howMany) {
    RowSet detailRowSet = (RowSet) row.getDlistLnVO();
    for (int i=0;i<howMany;i++) {
    Row detailRow = detailRowSet.createRow();
    detailRowSet.insertRow(detailRow);
    detailRow.setNewRowState(Row.STATUS_INITIALIZED);
    The problem here is when I add these detail records, ADF sets the master record to "dirty". My question is how do we reset the state of the master view object row to "Unmodified".

    Frank,
    That's my first thought. But I cannot find STATUS_UNMODIFIED in View Object. I understand the status can be set in Entity Object. How do we get ahold of Entity Object from View Object?
    Thanks.
    Message was edited by:
    user489605

  • Business Component and Task flow learning

    Hi everyone,
    can anyone suggest me how and from where I need to start learning Oracle BC ,Entity objects,View object and task flows concept . I am familier with Oracle ADF but never used this components.
    so Please help me to learn the thing quickly.
    Thanks in advance

    Hi,
    have a look here ADF Insider Basics - Introduction to Oracle ADF Business Components
    Note that the Fusion Developer Guide product documentation is all about ADF BC
    Getting Started with ADF Business Components - 11g Release 1 (11.1.1.7.0)
    Frank

  • Own View Object Rows filtering

    Hello,
    I've created a method which is filtering View Object for specific rows faster than getFilteredRows(). It is done by dynamic setting "where clause" and then removing it. Full method looks like that:
    public static Row[] filterRows(ViewObjectImpl vo, Map<String, Object> columns) {
            ArrayList<String> stringArray = new ArrayList<String>();
            for(String s : columns.keySet()) {
                stringArray.add(s + " = :" + s);
                vo.defineNamedWhereClauseParam(s, null, null);
                vo.setNamedWhereClauseParam(s, columns.get(s));
            String[] strArray = new String[stringArray.size()];
            String whereClause = StringUtils.join(stringArray.toArray(strArray), " AND ");
            vo.setWhereClause(whereClause);
            vo.executeQuery();
            RowSetIterator it = vo.createRowSetIterator(null);
            ArrayList<Row> rows = new ArrayList<Row>();
            while(it.hasNext()) {
                rows.add(it.next());
            for(String s : columns.keySet()) {
                vo.removeNamedWhereClauseParam(s);
            vo.getDefaultRowSet().setExecuteParameters(null, null, true);
            vo.setWhereClause(null);
            vo.getDefaultRowSet().setWhereClauseParams(null);
            vo.executeQuery();
            Row[] rowsArray = new Row[rows.size()];
            return rows.toArray(rowsArray);
        }Now, when i try something like this:
    MyViewObjectImpl searchVo = getContractAppMod().getMyViewObject1();
    Row[] rows = ContractUtils.filterRows(searchVo, "umwa_id", new Number(4));
    MyViewObjectRowImpl searchRow = (MyViewObjectRowImpl) rows[0];
    System.out.println(searchRow.getUmwaId());Everything seems to be OK, the values are correct, but when i try this:
    searchRow.setFirstName("Name");Value in adf table is not updating immediately like it is when i use searchVo.getFilteredRows("UmwaId", new Number(4)); instead of my filterRows method. Why is that happening and how to fix it?
    Thanks.
    Edited by: 983864 on 2013-02-23 04:40

    Definition of static filterRows() method is inside normal class named ContractUtils. Then i'm calling this method in bean class ContractBean. This bean is also declared in task flow. I don't know exactly how to rewrite my code for access the method through the ADF binding layer. Can you give me more specific clues? Thanks for all.

  • How to prevent creation of view object rows when using browser refresh butt

    HI i have the following problem:
    I have a creation form using a partial submition. The problem is that if i have entered some value by using autosubmit , this value will be setted as attribute in the ViewObject . After that if i click refresh button of the browser then the new Row of the view object will be created and i will have a pending row with setted attribute. So if execute commit then the both rows will be tried to commit. How can i prevent this?
    Krasi

    Hi,
    If i've understood you have a invokeAction that create a new row, right? If yes put on condition that it invokeAction won't invoke if is a postback.
    Let me know if i miss understand your doubt.
    Best Regards

  • New view object row does not get committed to DB

    Hi guys,
    on a taskflow with a new transaction I have a form to enter a new record on an entity-based view object.
    Before the page is called I call the CreateInsert Operation to create the new record on that view object.
    There are quite a few attributes that have default values which I determine in the ViewRowImpl's create method (using populateAttributeAsChanged to set the values).
    Now if none of the inputValues in the form is filled manually and I want to save the data (default values are sufficient to save the record) the taskflow return action commit does not commit the data to the db. As soon as I manually enter one value into any field the same return action commits the record correctly to the db. There is no error message and the new record is visible in the application because it is inserted into the view's iterator...
    Is there any way to mark the new row as changed/insert if only the default values are filled? Or am I doing something wrong?
    Using JDev 11.1.1.5
    Achim

    Add the following method in your RowImpl class:
    public void setNewRowState(byte b) {
         if (b != Row.STATUS_INITIALIZED ||
             getNewRowState() != Row.STATUS_NEW) {
             super.setNewRowState(b);

  • Sort view object rows with transient attributes

    Hi ,
    Is it possible to sort the results of a view object based on the populated transient attributes ?
    Best regards
    K

    K,
    Have you had a look at section 27.5 of the ADF Developer's Guide for Forms/4GL Developers ("Performing In-Memory Sorting and Filtering of Row Sets") - I've not tried it with transient attributes, but it does describe how to do in-memory sorting, as opposed to the normal way of sorting which is to send an ORDER BY to the database.
    Hope this helps,
    John

  • How to access and set the object attributes in a task flow?

    I have created a web service data control which has an operation having input as payload object. This payload object has two attributes min and max. I am calling a task flow in a dynamic region in which I want to display result of this operation for which i have to set the values for min and max. I want to set these values when I click the taskflow link. How to achieve this? I am new to adf.

    Hi Arun,
    Thanks for your reply.
    I have tried passing parameter to a task flow, but i cannot set the action to a task flow call because it already has action for a method in a dynamic region which renders the task flow at runtime. How do i set action to task flow call link? Also once i get the parameters into the page flow scope variables, i want to pass those to one of my data control operation which displays the result in that taskflow.(i dont want to create parameter form for this operation).

  • Changing Runtime View Object Settings Before and After Using Them

    Hi,
    I'm doing some VO coding at the moment and reading around the subject to get an idea of best practices.
    I stumbled across 2 blogs that are slightly contradictory:
    https://blogs.oracle.com/vijaymohan/entry/applyviewcriteria_design_timerun_time_view_criteria
    http://radio-weblogs.com/0118231/stories/2007/05/23/avoidActivationErrorsByChangingRuntimeViewObjectSettingsBeforeUsingThemNotAfter.html
    What is the best practice when programmatically using VOs? Should I do cleanup before/after when using them.
    Thanks
    Kevin

    John,
    I read it in an unofficial blog somewhere yesterday and I cannot locate it now!
    I'm reading some official documentation on this today:
    http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#autoId37
    The example steps given in 40.8.2 seems to contradict the latter paragraph:
    Because many of the view object's instance settings are saved in the passivation state snapshot and restored on activation (as described in Section 40.5.1, "State Information Saved During Passivation"), it is not advisable to change any of these settings just after executing the view object+ if you won't be re-executing the view object again during the same block of code (and so, during the same HTTP request). Instead, change the view object instance settings the next time you need them to be different before executing the query.
    Steps 5 and 6 seems to be changing the settings after executing the view object.+
    Bottom line is I'm looking for best practice.
    Should I do this in a VOImpl method:
    //save original VO settings
    String originalWhereClause = this.getWhereClause();
    String originalOptimizerHint = this.getQueryOptimizerHint();
    String originalOrderByClause = this.getOrderByClause();
    String[] originalViewCriterias = this.getApplyViewCriteriaNames();
    //change VO where settings and execute query
    //restore original VO settings
    this.setWhereClause(originalWhereClause);
    this.setApplyViewCriteriaNames(originalViewCriterias);
    this.setQueryOptimizerHint(originalOptimizerHint);
    this.setOrderByClause(originalOrderByClause);
    Or is that all unnecessary?

  • Problem with ADF security and task flow calls

    Hi.
    I am using JDeveloper 11.1.2.0.0.
    I encountered a problem when tried to apply ADF security to my application.
    The way to reproduce the problem:
    1. Create new Fusion Web Application;
    2. Import Business Components from Tables from any existing schema and add at least one table to the ApplicationModule.
    3. Create "welcome page" (for instance, welcome.jsf). Add a button with fixed action outcome "test".
    4. Create test page, for instance, test.jsf. Drag and drop any view object from Data Controls onto the page and create a form with navigation controls. Add a button with fixed action outcome "return".
    5. Create bounded task flow, name it "test", drag and drop our test page on it - the page will be the default activity. Add a task flow return activity. Add a control flow case from the default view activity to the return activity, set From Outcome property to "return". So our return button should cause the task flow to exit.
    6. Open adfc-config.xml in diagram mode and place our welcome page on it. Then drag and drop the test task flow to create a task flow call activity. Add a control flow case from welcome page to task flow call activity, set the From Outcome property to "test". So our test button should call the test task flow.
    7. Configure application to run the unbounded task flow starting with Welcome view activity.
    At this point all works as expected: when application runs, the welcome page is displayed with test button. Pressing the test button results in displaying the test page, return button leads back to the welcome page.
    Now let's configure ADF Security.
    Run the ADF Security configuration wizard, choose ADF Authentication and Authorization.
    On the second page select Form-Based Authentication, check the Generate Default Pages flag.
    On the third page choose No Automatic Grants.
    On the next page keep the Redirect Upon Successful Authentication unchecked. Press Finish.
    Open jazn-data.xml to configure roles, users and resource grants:
    1. Create application role test-role.
    2. Grant the test-role privileges to view the test task flow.
    3. Create user and grant him the test-role.
    Now we have the public available welcome page and the test page with restricted access.
    When application runs, the welcome page is displayed as expected. Pressing the test button redirect us to auto-generated login page. After successful authorization the test page is displayed. But nothing happens if we click now the return button for the first time. When we click the return button once more, the application crushes with Error-500 and message "Target Unreachable, identifier 'bindings' resolved to null". The exact error trace depends on UI control bindings, but looks like this:
    javax.el.PropertyNotFoundException: //C:/Users/DUDKIN/AppData/Roaming/JDeveloper/system11.1.2.0.38.60.17/o.j2ee/drs/Test1/ViewControllerWebApp.war/test.jsf @10,120 value="#{bindings.Id.inputValue}": Target Unreachable, identifier 'bindings' resolved to null
         at com.sun.faces.facelets.el.TagValueExpression.isReadOnly(TagValueExpression.java:122)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:476)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:390)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.wasSubmitted(EditableValueRenderer.java:345)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.decodeInternal(EditableValueRenderer.java:116)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.decodeInternal(LabeledInputRenderer.java:56)
         at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:342)
         at org.apache.myfaces.trinidad.render.CoreRenderer.decode(CoreRenderer.java:274)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1324)
    (the rest of lines skipped).
    Any suggestions?
    Edited by: user13307311 on Apr 16, 2013 11:39 PM

    @Lovin_JV_941794
    The welcome page is public available since it does not have appropriate PageDef file.
    Login page comes not from the welcome page, it comes after attempt to access the test page. So after the login succeeded the test page appears, because redirect to welcome page after successful login is not configured. I do not need to return the welcome page at this moment, I need to go to the test page.
    It seems the task flow call stack to be destroyed after redirect to login page.
    Edited by: user13307311 on Apr 17, 2013 12:45 AM

  • ADF Regions and Task Flows

    Hi,
    I'm attempting to create a search bar, that would be added to all of my pages in my application.
    I have created a fragment that has a comboBox, a text field, and a commandButton. These three things make up my search bar. Then I added the fragment to its own bounded task flow. I then added the task flow to one of my jspx's as a region.
    Ideally, I'd like to do that on every page.
    When the search commandButton is pressed on any page, I would like the user to be redirected to a 'search results' page (that is not a fragment). With the value selected in the choice list, and the value entered in the input Text, I would like to call an executeWithParams before entering the 'searchResults' page.
    I'm wondering how I would do this with task flows, considering I have my searchBar in a boundedTaskFlow, and my other pages are not. There is no 'call' to my Search Bar bounded task flow, it is just a region on all the pages.
    What can I do to navigate from my search Bar (in a region on all pages) to my search result page?
    Any help or guidance will be appreciated.
    Thanks,
    Joel

    That's a good point.
    I oversimplified my original explanation. I don't need the search bar in all pages, but many pages.
    I went back and forth between A) making multiple templates, or B) creating a facet for the search bar in my current template, where pages that use it can place the search bar fragment/bounded task flow.
    I was trying to go with option B.
    Which option is easiest/best?
    Thanks,
    Joel

  • Unable to extract all the currencies using Task Flow

    Hi Everyone,
    I have 60 currencies that I extract using a Task Flow in HFM 11.1.2.1 to a SQL table, I only receive 59 of those currencies FX Rates in the SQL table. The CNY currency does not extract at all.
    I have tried changing the PoV around with no success. I don't think it is the PoV anyway because the other 59 currencies have no problem.
    Any inputs please...
    Regards,
    Vinod

    Sounds like this is using an EA extract process. In your Task Flow, can you extract just that one (CNY) currency? If you do this directly in Extended Analytics, is the output any different from the Task Flow? How about if you extract to a text file rather than SQL?

  • JSP/BC4J app: How to get view object row data into a scriplet variable?

    I have a JSP application using BC4J data tags. Within a rowsetiterate tag, how can I get the data value of an attribute for the current row into a scriplet variable?
    Thanks,
    Steve

    Using the <jbo:Row> tag like this:
      <jbo:RowsetIterate .... >
        <%--
         | Establish a scriptable variable "curRow" for the current row
         +-->
        <jbo:Row id="curRow" action="current"/>
        <%
          String foo = (String)curRow.getAttribute("YourAttrName");
        %>

Maybe you are looking for

  • In EJB3 entities, what is the equiv. of key-cache-size for PK generation?

    We have an oracle sequence which we use to generate primary keys. This sequence is set to increment by 5. e.g.: create sequence pk_sequence increment by 5; This is so weblogic doesn't need to query the sequence on every entity bean creation, it only

  • Email notification for user created through reconciliation in OIM

    Hi.. I have done the following configurations for email notification when user is created through reconciliation in OIM Configuring IT Resource      Name     Email Server      Type      Mail Server      Authentication     FALSE      Server Name     *

  • WMII session configuration

    Hey guys, Wmii talks about session configuration, but I'm not sure how to go about it. I suppose you could issue some commands in one of the config files (~/.wmii/rc?). But I don't really know which commands to help choose clients. This is what I do

  • Can't get a class to display properly (TabPanel awt)

    Hi, thank you checking this out. I have renewed my interest for Java but need to start at the very beginning again. I have actuallu read up on AWT. Yes yes, I will follow up with Swing but for now I am just testing the waters again. However, I cant m

  • Recieve email but unable to send

    I am able to recieve email but every time I try to reply to an email the reply sits in the outbox and even a message that the mail has not been sent and the mail remains in the outbox.  I have checked all my a ccount settings and they seem fine.  Any