How to add row in multiple view object based on common entity object.

Hi ,
I have
Jdeveloper version - 10.1.3.3.0
Oracle Database - 11g R2
I have a situation where i have to show data from one table in three adf tables on jsf page depending on a flag value in a column in table. For this purpose i have done the following steps
a) Created an entity object on the database table .
b) Created three view objects on this entity object and edited the view object's SQL and included the where clause
                   WHERE  A.USER_PERSONAL_NO = :P_USER_PERSONAL_NO AND
                       A.AUTH_TYPE = 'LF'
                   The auth_type cloumn decided in which view object the data will be shown
Now, when i query the data from database by executing the query of these view objects the data is shown correctly in all three view objects. Till here there seems every thing ok
Now , i have to provide the logic to add records in the adf tables for this i have provided add button in action facet of all three tables which are binded to methods in managed bean,
when i add a record in a adf table by add button the new row which is created is shown in all three tables . I cant understand why this is happening , please help me to solve this problem.
How can i make it possible so that the record appears only in that adf table in which the record is added.
The method for adding record is
            Row rw = currentAM.getWfRecommAuths().createRow();
            rw.setAttribute("UserPersonalNo",this.getQuery_personal_no().getValue());
            rw.setAttribute("AuthPersonalNo","");
            rw.setAttribute("AuthType","LX");
            currentAM.getWfRecommAuths().last();
            currentAM.getWfRecommAuths().insertRow(rw);
           Please help , thanks in advance.

Hi,
have a look at polymorphic view objects
http://download.oracle.com/docs/cd/E21764_01/web.1111/b31974/bcadvvo.htm#CEGDCCCB
Frank

Similar Messages

  • Create Tabular Form wizard - how to add rows to Table / View Owner list?

    Create Tabular Form wizard asks to choose "Table / View Owner"
    How to add additional schemas/users to this "Table / View Owner" dropdown list?

    Next step:
    I tried to create 2nd application - and it sees and allows to select from schemas I added in previous step.
    Then I tried to add 1 more schema - and 2nd application can't see it...
    I create 3rd application and select 1st schema (assigned when workspace was created) - and it sees only this one schema
    I create 4th application and select another schema (added in previous steps) - and it sees 2 schemas from 4 assigned
    what is this?
    how to live with it?

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • How to Insert the row in the View object

    I want to insert the row in the view object by instantiating Impl.java file
    Could someone please let me know how to insert the blank row
    Thanks

    Inserting onto a view object should be done the following way:
    //vo is your view object
    Row aRow = vo.createRow();
    //Set your attributes
    aRow.setAttribute("AttributeName", objectValue);
    //insert
    vo.insertRow(aRow);
    That should work for you if you are programming the input. If you are using java components bound to columns in a view object then the input should be done automatically for you when you commit.

  • How to set updatable property of view object on runtime

    Hello Gurus,
    I am new in adf and using jdev 11.1.2.3.
    I have two view object which has view link and they are based on entity object. In master view i have a column with the name of status. The target is if the value of status is 'active' then i want to allow add rows in detail view and if it is inactive then wants to disable adding or editing in the detail view.
    I don't know how to do this. I don't know how to get the other view object and how to set update able property and where to write code in entity object class or view object class.
    Any advice................
    Thanks in Advance

    There are multiple possible ways to archive this. As the VOs are in a master-detail relationship, you can opt to add a navigation method to the child back to the parent. This method can be accessed via java or groovy to allow the child access to the master row. Once the child has access you can use this to ask the master for it's status and if it's not active disable the edit and update buttons.
    If both master and detail are on the same page in the ui, there is an easier way. Drag the status attribute from the master table onto the page as e.g. inputText. This will create a binding for the attribute which changes if you select a row in the master table. As you don't need to inputtext, switch to the source mode of the page and delete it. This will remove the inputtext put keep the binding. Now you can use hte binding in an EL to set the disable property of other components to true like
    <af:commandButton text="commandButton 1" id="cb1" disabled="#{bindings.masterstatus.inputValue ne 'active'}"/>
    The button will only be active it the binding for masterstatus is active.
    Timo

  • 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

  • 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

  • How to add rows in tableview using javascipt

    Hi
    I had tableview and button in my page.If i click on the button one new row should be appended to the existing tableview.
    so , how to add rows in tableview using javascipt which are editable?
    Regards,
    Pydi.

    Hi,
      Javascript is client scripting language, which is mainly used for validations at the client side.
      To add new row using a HTMLB tag ucannot use javascript. Instead pass "visibleRowCount" variable to a abap variable and add the variable on every button click.. that wil increase the visible row count.
    Also the size of the table view is the size of the itnernal table, so append a blank like to the internal table or insert it at the top.
    If you are not using HTMLB tags and using simple HTML tags u can always add a row using java script.
    Regards
    Imran.

  • How to add rows using DefaultTableModel?

    I'm trying to figure out the ins-and-outs of creating a dynamic table.
    I looked for a tutorial, but none of the example programs I found dealt with my particular issue, nor did they explain anything.
    For instance, most of the examples looked like this:
            table = new JTable();
            defaultModel = new DefaultTableModel(10,5);
            setModel(defaultModel);But that doesn't work for me -- I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem.
              public MyTableModel() {
                            super(data, columnNames);
                    ...The above code complains that "you can't access data or columnNames until you call super()!"
    But I've seen plenty of example code that DOES send in parameters to super(). How do they get away with that? Is it because they are parameters to the constructor, whereas private/public members of the class are somehow different?
    I thought a variable is a variable -- why is one allowed but not the other?
    Lastly, I'm trying to figure out, practically speaking, how to load a database with X items, and be able to add rows later. Does that mean I need to use a vector for my data instead of Object[][]?
    I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables -- is there any difference between them as far as dynamic tables are concerned?
    I was under the impression that I needed to "switch" from ADM to DTM if I wanted to be able to add rows to my table at runtime.
    Here are some references to previous discussions I found/participated in on this topic:
    http://forum.java.sun.com/thread.jspa?threadID=5224966
    http://forum.java.sun.com/thread.jspa?threadID=439141&start=0&tstart=0
    Thanks in advance for any help,
    Matthew

    -> I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem
    Well, you would pass in the data and columnNames as parameter when you create your table model.
    -> Lastly, I'm trying to figure out, practically speaking, how to load a
    -> database with X items, and be able to add rows later. Does that
    -> mean I need to use a vector for my data instead of Object[][]?
    You just said you extended DefaultTableModel. Well you don't need to do anything it already manages the data for you. You just use the methods provided to update and change the data.
    -> I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables
    No you haven't. You really don't understand what an AbstractDataModel is do you? Its nothing. You can't use it. It doesn't have any storage for the data, and since there is no data storage you can't access the data or change it. You can't even create an AbstractTableModel. Read your Java text on what an Abstract class it.
    The DefaultTableModel extends the AbstractTableModel to provide data storage and ways to get the data and change the data. It notifies the table when any change is made to the data so the table can repaint itself.
    -> How to add rows using DefaultTableModel?
    Finally, the DTM provides methods that make the model dynamic. Methods for adding and removing rows or adding and removing columns. Read the API for more information.
    If you still don't understand how how the methods work then search the forum for examples that use the methods you don't understand. I've posted an example the uses the methods required to add rows or columns.

  • Way to rollback only one row of a view object

    Is there a way to "rollback" only one row of a view object? That is, two or more rows have been modified but we wish to only restore one of the rows to the original (database) values.
    Is there a way to retain all of the current rows in all of the view objects for an application module after issuing a jbo:Rollback?
    Thanks

    Is there a way to "rollback" only one row of a view object? That is, two or more rows have been modified but we wish to only restore one of the rows to the original (database) values.In jdev903, a new method is being added to Row interface to reset the row state to the transaction-original state i.e., rollback the row to it's original values.
    Is there a way to retain all of the current rows in all of the view objects for an application module after issuing a jbo:Rollback?No. You may however override before/afterRollback methods on the ViewObjectImpl subclasses to cache the current row key in beforeRollback and restore currency on the default iterator to that rowkey in afterRollback
    Thanks

  • How to add titles to multiple pictures at same time in iphoto11

    I am having difficulty navigating in iphoto11.
    Can not figure out how to add keywords to multiple photos
    or how to add the same title to multiple photos.

    Titles: Photos menu -> Batch Change.
    Keywords: Select a batch of pics. Apply keyword to one, it's applied to all
    Regards
    TD

  • How to add list of multiple file types to file type of file dialog box in LabVIEW

    How to add list of multiple file types to file type of file dialog box in LabVIEW?
    In file dialog box there is option to add only one file type,in the list,not by seperating commas,
    regards,
    Naresh.N

    Write the file types in pattern Input string, separated by a semicolon ;
    For example:  *.vi;*.doc;*.jpeg;*.xls
    This should return the set of files with matching extensions
    Message Edited by devchander on 09-10-2008 08:02 AM
    Message Edited by devchander on 09-10-2008 08:03 AM

  • URGENT: Insert multiple rows in a view object cache from the same Page

    Please let me know whether I can get insert multiple rows in the same view object from a single page.
    I'm using UIX on Jdeveloper 9.0.5.2
    Thanks a lot.

    Hi,
    please check Duncan Mills how-to on this
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    Frank

  • Need help on how to specify the current select row in a View Object

    Hi,
    I have a ADF table on my page, when I was selecting the rows in this table, I want the set and get methods in the ViewRowImpl class to do some customized actions. I found out that each time regardless the row I select in the table, the viewrowimpl class will always return the data in the first row, I tried to use getCurrentRow in VO row impl. but still, gets the first row.
    Does anyone know how to get the selected row value in the View Object, or View Row Impl rather???
    Thanks!

    Hi,
    you can call a method exposed by the AM and pass teh rowKey of the selected row as an argument. When you configure the exposed AM method in the pageDef (creating a method binding) the argument is shown in a dialog from where you can use EL like #{bindings.iteratorName.currentRow.rowKey} to access the current selected row.
    Frank

  • How to Filter & Sort on Cached view object data?

    We are using JDeveloper 9.0.3.4 and implemeting a Struts/JSP application that query's via view object on one table. Is it possible to sort and order by on the view object's cached data? How does one do this?
    Thanks
    Natalie

    As for filtering rows, there are two ways:
    1. In the VO that's sorting data (in my article), you can add logic to skip unmatching rows in the following methods:
    protected boolean hasNextForCollection(Object qc)
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet)
    2. In the base VO (unsorted), you can apply a RowQualifier. For example,
    oracle.jbo.server.RowQualifier rowQual = new oracle.jbo.server.RowQualifier("EmpDeptNum = 20");
    myVO.setRowQualifier(rowQual);
    Thanks.
    Sung

Maybe you are looking for