ADF Master Detail Insertion and updation

Dear All
I am developing a web application with the ADF using ADF BC4J as a buisness service and JSP as th view.
I am creating a Master detail page that makes the user add the ,master and the detail(s) information in the same page.
Example:
you may insert the department and the employess in that department in the same transaction (post) also the update

Two questions...
1. Will a future version of Jdeveloper support a drag and drop update-able multirow table?
2. The existing example of doing this (Without Jheadstart) behaves different than a single row input form, as Duncan Mills points out, in that it loses the values that are input if validation errors occur. This same thing happends in the JHeadstart workspace.
a) after running the code and just showing the bindings and form values, it appears a standard input form has the new values immediately after processUpdateModel(). Even if they are in error, and it later fails to make it through validateModelUpdates the values are retained.
b) in the Multi-row example, you can examine the form bean values (for the multiple rows), and examine the values from the rowset obtained through the DCUtil.findSpelObject() and JUCtrlValueBindingRef calls, and the bindings don't change. The validateModelUpdates still manages to produce the error though.
So, with a multi-row update form...
a) How do you get the ROW specific error msg generated from a declarative or method-based validator? - that is, put a msg in for the row like: You can't put XXX into this field.
Right now, we modified the BEAN to include an ErrMsg column and added that as a transient attribute to entity and view, and can display the messages via that by putting them in during the processUpdateModel(). Of course, most of the validation ended up in the processUpdateModel(), with none in the Entity.
b) Where are those values going if they are placed into the bindings as they can't be examined later after processUpdateModel?
Here's a method stub that we used to show values...
   * showFormValues retrieves the array of form beans as well as the
   * EmployeesView1.rangeSet, and displays the form values for Salary
   * and CommissionPct against the JUCtrlValueBindingRef (row-based)
   * bindings from EmployeesView1
   * @param actionContext
  private void showFormValues( DataActionContext actionContext )
      DynaActionForm  updateForm = (DynaActionForm) actionContext.getActionForm();
      UpdateRowBean[] updatedRows = (UpdateRowBean[])updateForm.get("Row");
      System.out.println("********** showFormValues **********");
      java.util.List origRows =
        (java.util.List) DCUtil.findSpelObject(actionContext.getBindingContainer()
                                             , "EmployeesView1.rangeSet");
      // Now loop through the bean array
      for (int i = 0; i < origRows.size(); i++)
         //Get the rowKey of the submitted updated Row 
         String theRowKey = updatedRows.getRowKeyStr();
//Get the corresponding row from the origional set
JUCtrlValueBindingRef oldRow = (JUCtrlValueBindingRef)origRows.get(i);
//Check the update row needs processing and matches the source row
if (oldRow.get(JUCtrlValueBindingRef.RANGESET_ROW_KEY_STR).equals(theRowKey))
// Form value - does not appear to change
System.out.print( i + ": sal=" + updatedRows[i].getSalary() +
", comm=" + updatedRows[i].getCommissionPct() );
System.out.println("....Salary=" + oldRow.get("Salary") +
", CommissionPct=" + oldRow.get("CommissionPct") );
} // match on rowKeyStr
} // for i
System.out.println("************************************");
} // showFormValues

Similar Messages

  • ADF Master Detail Insert Page

    Hi all,
    i must create a jsp with a master detail in insert mode. The problem is that the master and the detail must be validated in the same time because i must have a record in the master that must have NECESSARILY a record in the detail.
    All the samples that i've been found makes validate first the master and then the detail...can anyone help me?
    Thanks in advance...
    Fabio

    you make both insert, whitout any automatic validation...then, in the onCommit metod manually check your conditions, and eventually you force rollback: what about this solution?

  • Can we use both INSERT and UPDATE at the same time in JDBC Receiver

    Hi All,
    I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
    user send the file which contains both new and old record and I need to save those in MS SQL database.
    If the record exist then use UPDATE otherwise use INSERT.
    I looked on sdn but didn't find any blog which perform both the things at the same time.
    Interface Requirement
    FILE -
    > PI -
    > JDBC(INSERT & UPDATE)
    I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
    Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
    Thanks,

    Hi ,
              If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
    "If the record exist then use UPDATE otherwise use INSERT."
    Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ...  where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows  you proceed with "insert into tablename....." since there are no old records present in database.
      Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database.  A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server.   If you need further help on how to write and call stored procedure in MS SQL you can look into these links
    http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
    http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
    [ This part you can ignore, Since its not sure that you will face this situation
        Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
    http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
    http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
    http://www.faqs.org/docs/ppbook/r27479.htm
    http://msdn.microsoft.com/en-US/library/ms187373.aspx
    http://msdn.microsoft.com/en-US/library/ms173763.aspx
    http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
    http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
    http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
        There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
    regards
    Anupam

  • ADF Master Detail Forms

    Hi,
    We have a master detail views and the master detail relationship is working fine between the views. We have a requirement to display one master form and 2 detail forms (user has to see two detail forms) to the user. The default master detail relationships in ADF are displaying one master form and one detail form with the navigation controls. Can you please suggest ideal approach for displaying multiple detail forms.
    We tried with the af:iterator for displaying details collection model as multiple forms. But the problem with the current approach, we are unable to get the reference to the detail record when a value is changed in the detail form.
    <af:iterator id="i1" varStatus="vs" value="#{bindings.BillDetailVO11.collectionModel}" var="row">
    <af:inputDate id="serviceDate"
    label="Service Date"
    value="#{row.ServiceDate}" *valueChangeListener="#{backingbean.myvaluechangelistener}"*
    columns="9"/>
    <af:inputText id="it1122" label="POS"
    value="#{row.PlaceServiceCode}"
    columns="4"/>
    </af:iterator>
    I am comfortable with the iterator approach if I can get the value of PlaceServiceCode for the same row in the detail form when the ServiceDate value changes. I am ready to try for alternative approaches for displaying multiple detail forms.
    Thanks and Regards,
    Prasad

    Hi Shay,
    Thank you for responding to my query. I followed the steps in the blog and created two detail forms. But both the detail forms are representing the same detail record. Our requirement is little different.
    We have to create a master detail form (Bill Summary with Bill Lines) to edit the bill summary with lines and display two Bill lines along with summary to the user.If hte number of bill lines are more than 2 then we have to display navigation controls to the user to navigate across the bill lines.
    As an example the form data comes from Bill_summary(Master) and Bill_Lines (detail) tables. If the number of Bill Lines are 5 then we have to display the form as follows. if the user selects next the form should display 2,3 lines, 3,4 lines etc.
    BILL_SUMMARY
    BILL_LINE 1
    BILL_LINE 2
    <Navigation control for the details>
    Thanks and Regards,
    S R Prasad

  • Adf master -detail data table

    Hi,
    I have adf master detail data table , I put af:selectbooelancheckbox and autosubmit is true in detail data table .When I click the detail table , valuechangelistener of the af:selectbooelancheckbox is runnig I don't want this situation. Is it possible to prevent this ?
    regards,

    Hi
    I can't remove autosutmit = true because I handle the valuechangeevent in managedbean.Why master table event fire the valuechangeevent in detail table ? I check the submit source in managedbean but It doesn't prevent to fire valuchangeevent ? Is there any way except ignore autosubmit = true ?
    thx,

  • Master Detail between two updatable tables ( advance tables)

    Hi,
    I have two advanced table regions, and both are updatable. They have Master detail relationship , and on clicking on the select button in the Master region, the updatable child region ( with generally more than one records), is displayed.
    The problem is, if I enter the details in the child region for one of the master records, and then without saving , move to the second master record, then the data is lost for the child records for the first master record.
    How do I retain that, without explicitly saving?
    I am having a handleSelection PPR event on the select radio button, and in that, I am executing the query for the child VO.
    Any help is appreciated !
    Thanks,
    AJ

    Hi!
    I don't understand that question.
    A Master Table could have a lot of Detail Tables.
    You can see that with SQL Workshop.
    Can you give me more details of that problem?
    Gerhard

  • Master-detail insert records form?

    Hi,
    I want to be able to build a master-detail insert form based on a BC4J, any ideas on the easiest way of doing this?
    I tried using the Data Web Beans from the JSP Element wizards, and found it possible to build a master-detail form for viewing data based on a BC4J application, but not inserting.
    I know it is probably possible to do this by coding your own Data Web Beans but is
    there any way of doing it with the Web Beans available?
    Thanks in advance.

    If you have a ViewLink in your AppModule for the master/detail tables, then the JSP application wizard automatically creates a master/detail page for this view link. You may want to use the generated page and modify it.

  • In jdbc adapter what is the difference between insert and update insert

    in jdbc adapter what is the difference between insert and update insert
    Edited by: katru vijay on Mar 22, 2010 7:43 AM

    Please refer to this Link [Document Formats for the Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/Helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm]
    Hope this helps.
    Regards,
    Chandravadan

  • Oracle forms 10g,multiple insert and update problem

    Hi,
    I have tabular form(4 records displayed) with one datablock(based on a view).
    After querying the form could not update all the records but only first record value can select from LOV.
    I called a procedure in in-insert and on-update
    The query is lik this
    PACKAGE BODY MAPPING IS
         PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
         IS
         BEGIN
              IF (EVENT_NAME = 'ON-INSERT') THEN
                   INSERT INTO XX_REC_MAPPING
                   (BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
                   CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
                   VALUES
                   (     :XX_REC_MAPPING.OFFICE_CODE,
                        :XX_REC_MAPPING.COLLECTION_ID,
                        :XX_REC_MAPPING.PAY_MODE_ID,
                        :XX_REC_MAPPING.RECEIPT_METHOD,
                        :XX_REC_MAPPING.CREATED_BY,
                        :XX_REC_MAPPING.CREATION_DATE,
                        :XX_REC_MAPPING.LAST_UPDATED_BY,
                        :XX_REC_MAPPING.LAST_UPDATE_DATE,
                        :XX_REC_MAPPING.LAST_UPDATE_LOGIN);     
              ELSIF (EVENT_NAME = 'ON-UPDATE') THEN          
              UPDATE     XX_REC_MAPPING
              SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
                        COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
                        PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
                        RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
                        LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
                        LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
                        LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
                        WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
              END IF;
         END INSERT_ROW;
    END MAPPING;
    Whether the table gets looked or sholud i use some other trigger or loops ?
    someone suggest me how to edit this query for multiple update.
    Thanks
    sat33

    I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
    If it's not an updatable view, use instead of triggers on the view.
    See this current thread too:
    INSTEAD of Trigger View for an Oracle EBS New form development

  • Inserting and Updating records in ORACLE using WebDynpro Java

    Hi All
    I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
    i have created views  for insert and update,
    Thanks in advance
    Sushma

    Hi shusma..
    chk this link..
    <b><u>Creating Connection</u></b>
    package com.sap.xirig;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class DBLookup {
    String Conn_Status = "Not Connected";
    String Language_Desc = "Empty";
    String Language_Cd = "Empty";
    Connection conn;
    Context ctx;
    DataSource ds;
    //Constructor for the DBLookup object
    public DBLookup {
    try {
    ctx = new InitialContext();
    if (ctx == null) {
    throw new Exception("Boom - No Context");
    // If JDBC 2.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
    // If JDBC 1.0 connection is used please create the DataSource object as below
    // ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
    if (ds == null) {
    throw new Exception("Boom - No dataSource");
    catch (Exception e) {
    e.printStackTrace();
    public String getLanguageDesc(String v_str) {
    Statement stmt = null;
    ResultSet rst = null;
    try {
    if (ds != null) {
    conn = ds.getConnection();
    Conn_Status = "Could not get connection to
    datasource";
    if (conn != null) {
    Conn_Status = "Got Connection " +
    conn.toString();
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT
    LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
    if (rst.next()) {
    Language_Desc = rst.getString(1);
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    if (rst != null) {
    try {
    rst.close();
    catch (Exception e) {
    e.printStackTrace();
    if (stmt != null) {
    try {
    stmt.close();
    catch (Exception e) {
    e.printStackTrace();
    if (conn != null) {
    try {
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    return Language_Desc;
    http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
    Hope this will help u..
    URs GS

  • Adf Master Detail disclosed

    I have a master detail table and i want to my table, when page loads, all nodes come expanded. How can i do this?
    Sorry about my english and thanks.

    Hi,
    in a managed bean, create a JSf reference to the table. Then use
    public void setTable(CoreTable table) {
    RowKeySet rks = new RowKeySet(true);
    table.setDisclosureState(rks);
    this.table = table;
    Frank

  • Find All INSERTs and UPDATEs

    Hi All;
    I want to find out all inserts and updates of a spesific table. For instance a package l,ke that
    CREATE OR REPLACE PACKAGE BODY param_test IS
      PROCEDURE ins_test IS
      BEGIN
    insert INTO parameter_value VALUES (2);
        INSERT INTO parameter_value VALUES (9);
        INSERT  INTO
        parameter_value VALUES (4);   
        insert INTO parameter_value VALUES (54);
      END ins_test;
    END param_test;I am querying user_source view. My query is below.
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    Connected as SYS
    SQL> SELECT us1.NAME, us1.line, us1.text
      2    FROM user_source us1,
      3         (SELECT us2.line, us2.NAME, us2.text
      4            FROM user_source us2
      5           WHERE regexp_like(upper(us2.text), '[[:space:]]*PARAMETER_VALUE[[:space:]]*')) us3
      6   WHERE us3.line - 1 = us1.line
      7     AND us1.NAME = us3.NAME
      8     AND regexp_like(upper(us1.text), '[[:space:]]*(INSERT[[:space:]]*INTO|UPDATE)[[:space:]]*')
      9  /
    NAME                                 LINE TEXT
    PARAM_TEST                              9 insert INTO parameter_value VALUES (2);
    PARAM_TEST                             12     INSERT  INTO
    SQL> My question is "Are tehre any solutions to overcome this situation?"
    Kindly Regards...

    You might be better off combining into your attack the use of user_dependencies. This will tell you what objects e.g., code is dependent on your table and then you can search the source of those modules for inserts and updates into the table. Even then you'll never be sure, especially if dynamic SQL is used as the statement may be pieced together from various bits if strings, as then user_dependencies won't contain the reference.

  • Connecting to datasource and retrieve, insert and update data in SQL Server

    hi,
    i am trying to retrieve, insert and update data from SQL Server 2000 and display in JSPDynPage and is for Portal Application. I have already created datasource in visual composer. Is there any sample codes for mi to use it as reference???
    Thanks
    Regards,
    shixuan

    Hi,
    See this link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards,
    Senthil kumar K.

  • Master Detail Wizard and User Interface Defaults

    Trying to create a master/detail form (on one page, no report).
    1. Wizard is giving the option to use User Interface Defaults for the master table, but not for the detail (I don't want to for either) - is this the expected behaviour? If so, why the inconsistency? Will/can this be changed in the future?
    2. Despite selecting NOT to use UI defaults, and entering new region titles, wizard is creating default region titles using the UI defaults. Is this a bug?
    3. Supplementary: Is it possible to get rid of UI defaults?
    HTML DB 1.6.0.00.87

    I asked about this last month:
    Master Detail Wizard and User Interface Defaults
    with no response.
    Anyone?

  • Connecting to datasource and retrieve, insert and update data

    hi,
    i am doing a JSP page that need to retrieve data and display on textView, insert data and update data. I have already create a datasource in Visual Composer. Does anyone have a sample codes for mi to use it as reference. So that i can connect to the datasource tat i created in Visual composer and retrieve, insert and update data. thanz
    Regards,
    shixuan

    Hi,
    After creating a data source in Visual composer .
    you have to create a BI system that Visual Composer can use in
    the SAP NetWeaver Portal.
    refer this pdf file for further Info
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards,
    Beevin

Maybe you are looking for