Row highlight in master detail

I've created a master with a detail report on the same page so that when you click a row in the upper (master) region, you see the details in the lower region. At the same time the row in the upper region gets highlighted so you know what details you are looking at.
I did this as follows:
Create an application item CONTEXT_ID.
In the link in the master region CONTEXT_ID gets set to the row #ID#.
The detail region is based on a report template with column templates based on plsql expression:
condition for the non-selected rows:
v('CONTEXT_ID')is null or #ID#!=v('CONTEXT_ID')
condition for the selected row:
#ID#=v('CONTEXT_ID')
I'm reasonably happy with this solution it's easy to implement and works as long as your master table has a column named ID. The only drawback I find is that you have to specifically set CONTEXT_ID to null whenever you navigate to a page that uses this construction.
It would be interesting to hear what other solutions are out there that to the same kind of thing.

Yes, I did set the partial trigger. That's why when manually select the row on the master table, the detail table get refreshed. The problem is the first time entering the page, and not row get selected automatically in the master table. Here is the code snipplet of the detail table:
<af:table value="#{bindings.ItasLookupCodesVO1.collectionModel}"
var="row" rows="#{bindings.ItasLookupCodesVO1.rangeSize}"
emptyText="#{bindings.ItasLookupCodesVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.ItasLookupCodesVO1.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.ItasLookupCodesVO1Query.queryDescriptor}"
queryListener="#{bindings.ItasLookupCodesVO1Query.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.ItasLookupCodesVO1.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasLookupCodesVO1.collectionModel.makeCurrent}"
rowSelection="single" id="t2" partialTriggers=":::pc1:t1"
editingMode="clickToEdit" summary="Lookup Codes">
The table is a child of a panelCollection.
Any more ideas?
Thanks.
-Mina

Similar Messages

  • Keeping Row Highlighted In Master-Detail Table

    JDev 11.1.2.0
    I have a small .jsf page with a master-detail setup, using 2 tables.
    When I select a row in the master table, the detail table is populated as expected.
    When I select a row in the detail table, the row is no longer highlighted on the master table.
    Is there any way to have the row selection in the master table remain highlighted while the user is clicking around the detail table?
    I am not sure if it matters but I have manually added filtering to both tables.
    Thank you.
    Ray

    Any help would be appreciated.

  • Creating a new row in a master detail VO relation and its consequences.

    Hi,
    I'm currently facing a lot of problems which make me doubt if my perception about the whole ADF entity-view object mechanism is right.
    I have a page which displays data from a master detail VO relation (master offer - detail officeinfo). I also have a small dialog LOV window which makes it possible for me to select an office to match up with the current offer... Both the office LOV and the officeInfo detail use the same Office entity object.
    This worked perfectly fine until I wanted to add create NEW offers. I created my own insert method which basically performs a createRow on the master VO and inserts the newly created row in this VO. On a sidenote, I also fill out some default data read from a property file, which is why I decided to implement my own insert method in the first place.
    Initially, the problem was that the inputText fields of the detail VO (OfficeInfo) were not displayed at all. I imagined that I also had to perform the create and insert methods on the detail VO and indeed, from that point on all inputText fields were displayed and my page was ready for input.
    Yet today, I notice that in my Office LOV which is based on the same entity as the one my detail OfficeInfo VO uses, this newly created row is ALSO visible. To me this is quite unwanted and surprising behavior. I did not expect the row already to be visible in the LOV, since basically it's just an empty row ready for input...
    Am I perceiving things wrong? Or anyone has a nice solution to fix this?
    Thanks,
    Douglas

    Hi Douglas,
    It is happening because you have created an updateable office LOV which is based on same entity object used to save your newly created records.
    Use readonly LOV based on plsql query in your page and you can keep rest of the thing as it is.
    I think it will solve your problem.
    Cheers,
    Suyog

  • Weird Problem with Add Row Button in Master Detail Page

    I have a page that was created with a Master Detail Wizard. When I click the Add Row button on our Production Environment, the row counter increments BUT no blank row shows on the screen.
    In our Development Environment, when I click the Add Row button, a blank row appears as expected. Thinking there was some problem with the production app, I exported the Dev version and imported into Production. Still no blank row.
    Thinking perhaps it had something to do with the data, I copied our production application data back into the development application tables. Still, the development app creates the blank row where the production version does not.
    I even used the same browser window for both environments and still get the same results. This was working fine in production then just stopped one day.
    The only clue I have is that the Add Row WILL work if the Master Record has no details or less than a page worth. It seems to happen when the detail records are more than one page worth. Also, when I click the Add Row button, it goes to the last page of the list (say three pages of 10, 10, 6) but no blank row shows up. Again, works fine in the development environment no matter how many pages.
    Any ideas or suggestions why this is happening? Could there be some environment setting that is causing this to happen?

    I have a page that was created with a Master Detail Wizard. When I click the Add Row button on our Production Environment, the row counter increments BUT no blank row shows on the screen.
    In our Development Environment, when I click the Add Row button, a blank row appears as expected. Thinking there was some problem with the production app, I exported the Dev version and imported into Production. Still no blank row.
    Thinking perhaps it had something to do with the data, I copied our production application data back into the development application tables. Still, the development app creates the blank row where the production version does not.
    I even used the same browser window for both environments and still get the same results. This was working fine in production then just stopped one day.
    The only clue I have is that the Add Row WILL work if the Master Record has no details or less than a page worth. It seems to happen when the detail records are more than one page worth. Also, when I click the Add Row button, it goes to the last page of the list (say three pages of 10, 10, 6) but no blank row shows up. Again, works fine in the development environment no matter how many pages.
    Any ideas or suggestions why this is happening? Could there be some environment setting that is causing this to happen?

  • Multi-row insert in master-detail tables

    Hi, I'm using jdev 10.1.3.2 with jheadstart and my problem is:
    I hava a master-detail structure, both are tables and my goal is that I want multi insert (exactly 3) in master and detail table when user makes new order(some business scenario). I cannot create rows in master or detail VO by overriding create() method because its entities have complex primary keys and some part of this key is populated by the user with lov. So I set in jhs new rows to 3 and checked multi-row insert allowed but the problem is that overall I can only create rows in master table after I submit form. I want to create row in master table and fill rows in detail table, and after that I want to have opportunity to create second (or even third) row in master table and fill rows in detail table.
    thanks for help.
    Piotr

    See JHS DevGuide: 3.2.1. Review Database Design:
    If you are in the position to create or modify the database design, make sure all
    tables have a non-updateable primary key, preferably consisting of only one
    column. If you have updateable and/or composite primary keys, introduce a
    surrogate primary key by adding an ID column that is automatically populated.
    See section 3.2.4 Generating Primary Key Values for more info. Although ADF
    Business Components can handle composite and updateable primary keys, this
    will cause problems in ADF Faces pages. For example, an ADF Faces table
    manages its rows using the key of the underlying row. If this key changes,
    unexpected behavior can occur in your ADF Faces page. In addition, if you want
    to provide a drop down list on a lookup tables to populate a foreign key, the
    foreign key can only consists of one column, which in turn means the referenced
    table must have a single primary key column.
    Groeten,
    HJH

  • Error with "Add new Row" button in Master detail VO

    Hi,
    Am having a header VO , Forecast HeaderVO and a child VO
    ForecastLineVO, now forecastHeaderVO has two bind condition attached to it,and when we run header Vo line VO will automatically execute as they are linked by a view link.My child Vo is attached to a advance table, which has a ADD Another Row button,Now when i press the button for the case where no header is is there it shows me a error"Failed to find or invalidate owning entity".
    Below am giving the coding what i have written in the AM to handle the Add New Row button,
    public void createForecastTarget(String month, String year,String fortnight,String forecastmonth,String forecastyear)
    ForecastLineVOImpl vo1=getForecastLineVO();
    ForecastHeaderVOImpl vo=getForecastHeaderVO();
    System.out.println("Start");
    vo.setWhereClauseParam(0,month);
    vo.setWhereClauseParam(1,year);
    //vo.setWhereClauseParam(2,fortnight);
    vo.setWhereClauseParam(2,forecastmonth);
    vo.setWhereClauseParam(3,forecastyear);
    vo.executeQuery();
    if (!(vo1.isExecuted()))
    throw new OAException("ASF", // Message product short name
    "MIS_SEARCH_PENDING");
    // We need to do this on a VO that has not been queried before we insert
    // our first row. We don't want to do it for subsequent inserts.
    System.out.println(vo.getFetchedRowCount());
    if (vo.getFetchedRowCount() == 0)
    // vo.setMaxFetchSize(0);
    int rownum = vo.getFetchedRowCount() ;
    OARow row = (OARow)vo.createRow();
    int rownum1 = vo1.getFetchedRowCount() ;
    System.out.println("In between");
    OADBTransaction transaction = getOADBTransaction() ;
    Number forecastid = transaction.getSequenceValue("MIS_FORECAST_HEADER_S");
    Number forecastlineid = transaction.getSequenceValue("MIS_FORECAST_LINE_S");
    System.out.println(forecastid+" "+forecastlineid);
    row.setAttribute("ForecastId",forecastid);
    row.setAttribute("DataEntryMonth",month);
    row.setAttribute("DataEntryYear",year);
    row.setAttribute("DataEntryFortnight",fortnight);
    row.setAttribute("ForecastMonth",forecastmonth);
    row.setAttribute("ForecastYear",forecastyear);
    vo.insertRowAtRangeIndex(rownum,row);
    vo.clearCache();
    transaction.commit();
    // Required per OA Framework Model Coding Standard M69
    row.setNewRowState(row.STATUS_INITIALIZED);
    OARow row1 = (OARow)vo1.createRow();
    row1.setAttribute("ForecastId",forecastid);
    row1.setAttribute("ForecastLineId",forecastlineid);
    System.out.println("forecast id"+forecastid);
    vo1.insertRowAtRangeIndex(rownum1,row1);
    // Required per OA Framework Model Coding Standard M69
    row1.setNewRowState(row1.STATUS_INITIALIZED);
    else
    int rownum2 = vo1.getFetchedRowCount() ;
    System.out.println(rownum2);//+vo1.getCurrentRow().getAttribute(1))
    System.out.println(vo.first().getAttribute("ForecastId"));
    OARow row2 = (OARow)vo1.createRow();
    row2.setAttribute("ForecastId",vo.first().getAttribute("ForecastId"));
    OADBTransaction transaction = getOADBTransaction() ;
    Number forecastlineid1 = transaction.getSequenceValue("MIS_FORECAST_LINE_S");
    row2.setAttribute("ForecastLineId",forecastlineid1);
    // row2.setAttribute("DeleteAttr", "N");
    vo1.insertRowAtRangeIndex(rownum2,row2);
    // Required per OA Framework Model Coding Standard M69
    row2.setNewRowState(row2.STATUS_INITIALIZED);
    System.out.println("forecast line id"+forecastlineid1);
    Now while debugging i found out that am getting the error in the if block
    in the code
    OARow row1 = (OARow)vo1.createRow();

    Hi,
    Summit ,again am getting the error and i think am getting it in the line when am trying to create one for line VO
    as OARow row1=(OARow)vo1.createRow();
    Below am giving the stack trace
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1142)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1294)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2396)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
         at mis.oracle.apps.asf.dcp.frcst.webui.ForecastDealerCO.processFormRequest(ForecastDealerCO.java:158)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
         at mis.oracle.apps.asf.dcp.frcst.webui.ForecastDealerCO.processFormRequest(ForecastDealerCO.java:158)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:734)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:943)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1546)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:373)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:929)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:895)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:751)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:352)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:340)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2392)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1512)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    Please help.

  • Updating rows in a master-detail udo form

    Dear Sirs,
    I'm using a form connected to a UDO and I want to use standard services provided by SAP.
    In a column I have a CFL button, and if I set a new rows data with the following code in the et_CHOOSE_FROM_LIST event:
    oDetailDS.SetValue("U_ItemCode", pVal.Row - 1, code);  // code and name are variables containing values returned by the CFL
    oDetailDS.SetValue("U_ItemName", pVal.Row - 1, name);
    oMatrix.SetLineData(pVal.Row);
    this works fine until I add new rows in sequece, but if I attempt to modify an already inserted row, the sysstem gives the following error:
    "This entry already exist in the following tables "(@MY_UDO_ROWS) (ODBC -2035) [Message 131-183]
    Replacing the previous code with the following one:
    oDetailDS.Clear();
    oDetailDS.InsertRecord(0);
    oDetailDS.SetValue("U_ItemCode", 0, code);
    oDetailDS.SetValue("U_ItemName", 0, name);
    oMatrix.SetLineData(pVal.Row);
    oDetailDS.Clear();
    oMatrix.FlushToDataSource();
    the system let my update existing rows, but the both lineid and visorder fields are completely re-entered with new values and this make me loose all previous references and also change the order data are presente on the matrix.
    Can anyone help me to find the right way to insert neew rows and update existing ones?
    Thank you for the attention
    Massimo Landi

    Hi,
    Whenever you make changes to the existing record and want to update the record, you need to delete all the records from the child table pertaining to that entry. use the below code in BeforeAction=true.
    If pVal.BeforeAction = True Then
                        If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
                            oForm = oSBOApplication.Forms.ActiveForm
                            If pVal.ItemUID = "1" And pVal.FormMode = 2 Then
                                oEdit = oForm.Items.Item("txtOpnCode").Specific 'you master document number/code
                                oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                oRecordSet.DoQuery("delete from [@MY_UDO_ROWS ] where [Code/DocNum]='" & oEdit.Value & "'")
                            End If
                        End If
                    End If
    Regards,
    Noor
    Edited by: noor_023 on May 10, 2010 4:41 PM
    Edited by: noor_023 on May 10, 2010 4:42 PM

  • Master Detail Form - unable to add detail row

    Dear,
    I have a test application that runs for years on apex.oracle.com.
    Since 3rd of june 2010 I am unable to add rows on a detail form.
    Any ideas?
    Help is welcome!
    Kind regards
    Lorenz

    4.0 Conversion Issue
    Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
    I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
    My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
    Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
    Is this a reported 4.0 conversion issue?
    Jeff

  • Add Row in Master Detail Form

    Hi all,
    I wonder if there is a way to just Add Row in the master detail (tabular) form without actually submitting the page. So if user has updated any existing row before clicking the Add Row button, the update should not be submitted by Add Row button click. If this is possible, then I want to submit (insert) the newly added row as well as any updates made to the existing rows when user click the "apply changes" button.
    Any luck?
    Thanks for the help.
    Milaan

    Hi Andy,
    Thanks for your response. Here is what I am doing... On submit I am calling another page (popup) for user to enter electronic signature. So when they add row (which is a submit), it calls the electronic signature page popup, and only upon entering the signature (nuisance at this point) it adds a row in the tabular form. Is there a way to change this behavior to not to submit the page every time user click Add row button?
    Thnx
    Milaan

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • Insert Master Detail

    Hi all,
    I need to understand which is the fastest way for inserting rows in master-detail tables
    Using a procedure. I often insert lots of details rows and sometimes master-details rows
    Here there is my solution. Is there something faster?
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    CREATE TABLE MAIN_TRACING (
       MAINVAL VARCHAR2(10) NOT NULL,
       PAR1    VARCHAR2(10) NOT NULL);
    CREATE TABLE TRACING_DET (
       MAINVAL   VARCHAR2(10) NOT NULL,
       SUBPAR1   VARCHAR2(10) NOT NULL);
    CREATE UNIQUE INDEX MYPK ON MAIN_TRACING(MAINVAL);
    ALTER TABLE MAIN_TRACING ADD ( CONSTRAINT MYPK PRIMARY KEY (MAINVAL) USING INDEX MYPK);
    ALTER TABLE TRACING_DET ADD ( CONSTRAINT MYFK FOREIGN KEY (MAINVAL)  REFERENCES MAIN_TRACING (MAINVAL));
    CREATE OR REPLACE PROCEDURE ADD_TRACE(V_MAINVAL VARCHAR2, V_PAR1 VARCHAR2, V_SUBPAR1 VARCHAR2)
    AS
       PARENT_NOT_FOUND   EXCEPTION;
       PRAGMA EXCEPTION_INIT(PARENT_NOT_FOUND, -2291);
    BEGIN
       INSERT INTO TRACING_DET(MAINVAL, SUBPAR1)
            VALUES (V_MAINVAL, V_SUBPAR1);
       COMMIT;
    EXCEPTION
       WHEN PARENT_NOT_FOUND
       THEN
          INSERT INTO MAIN_TRACING(MAINVAL, PAR1)
               VALUES (V_MAINVAL, V_PAR1);
          INSERT INTO TRACING_DET(MAINVAL, SUBPAR1)
               VALUES (V_MAINVAL, V_SUBPAR1);
          COMMIT;
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.PUT_LINE(' Error code    : ' || TO_CHAR(SQLCODE));
    END ADD_TRACE;
    EXEC ADD_TRACE('m1', 'a', 'suba1');
    EXEC ADD_TRACE('m1', 'a', 'suba2');
    EXEC ADD_TRACE('m1', 'a', 'suba3');
    --exec ADD_TRACE('m1', 'b', 'suba3'); --IMPOSSIBLE!
    EXEC ADD_TRACE('m2', 'b', 'subb1');
    EXEC ADD_TRACE('m2', 'b', 'subb2');
    SELECT * FROM MAIN_TRACING;
    MAINVAL    PAR1
    m1         a
    m2         b
    SELECT * FROM TRACING_DET;
    MAINVAL    SUBPAR1
    m1         suba1
    m1         suba2
    m1         suba3
    m2         subb1
    m2         subb2

    The answer (as Tom Kyte is fond of stating) is "It depends" ;-)
    Is this something that is called scattered over the application? Most of the time it will be called with an existing MAINVAL and just sometimes now and again a new MAINVAL will be inserted? Subsequent calls to ADD_TRACE will typically have a different MAINVAL than the previous call?
    If that is the case, then your method is not a bad one. Many programmers would have first tested for existence of master and decided whether to insert it or not, which would then be wasted effort in 95% of the cases.
    Your method of assuming the master exists and then handle the exception if it does not - that is quite neat. But the key is - it has to be the exception to the rule that the exception handler is invoked.
    But if on the other hand you are calling ADD_TRACE pretty consecutively (sort of like your example) with first several calls with one MAINVAL, then several calls with a new MAINVAL, then several with a new MAINVAL, etc. - say a typical ETL process or loading data from perhaps a flatfile or something like that - then you would do better to do one insert of the parent and then bulk up the children in a bulk insert.
    So it depends on your use case. There is not one generally best way to insert into master-detail - there will be several depending on whether you are bulk loading data to your master-detail or you have scattered calls.
    But just one other thing concerning your code:
    Usually it is not a good idea to issue those COMMIT statements inside your procedure. How do you know if the caller has finished with the transaction or not?
    Either let the client/caller decide when the complete transaction is done.
    Or you may decide that this is tracing/logging and should be logged no matter whether the calling transaction commits or rollbacks, and then you can make ADD_TRACE use an autonomous transaction.
    (All of the above is just my personal opinion and you will likely find other people with different opinions ;-) )

  • Master-Detail: create detail-row(s) with id already filled in

    I have two tables with an one-to-many relationship (connected by 'id'). If you select a row from the master-table, you'll see the detail-table (with the various row's belonging to the master-record). Now I made a button which users can use to add additional rows to the detail-table. They get a form which they can fill in and submit, the only problem is... I don't want them to manualy fill in the id, this should be the only field that should already be filled in (or better should be invisible, but filled in). So they should select a master-row first and then click 'add' to add a detail-row(s) to it. But I have absolutely no clue how I can do this... I tried creating custom create methods in the view-object or entity-object... but the problem I keep running into is where to get the row-iterator... I have know idea if this is the right direction to look for, maybe somebody can give me some advice.
    Thanks in advance...!

    Steven, hope you can help me out once more...
    I have the same problem with a different view object, I'll explain...
    First of all I set jbo.locking.mode to 'optimistic', now the problem...
    I have two entity objects (Mbrships and Mbrshiphistory) which are connected by a foreign key (created in the database) on MbrshipID. Mbrshipshistory is also connected to the Aff entity object by a foreign key on AffID. The idea is simple... there are affiliates and a couple of memberships. An affiliate has/had a membership, that's where the membershiphistory-table comes in, which stores AffID, MbrshipID, DateFrom, DateTo and some other values.
    Now, what I created... JDeveloper created entity-objects of all the tables and made associations of the foreign keys. I created the following view objects: http://213.93.142.238/oracle/datamodel.jpg and application module: http://213.93.142.238/oracle/applicationmodule.jpg The (MemberToMembershipHistory) view link between Members and MembershipHostory is based upon the association between the two tables.
    The following is a screenshot of my struts-config.xml: http://213.93.142.238/oracle/struts-config.jpg
    Editing mbrshiphistories works fine, but I get the following error when I try to add one: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity. I also don't see the AffID already filled in in the add/edit-screen (same problem as in the opening-post) when I try to add one. I double-checked everything, but I can't find the problem. Do you know what I do wrong...?

  • Creating master detail rows

    using adf/bc with jsf. I have defined a master detail relationship between two entities. This relationship is a composition relationship. The entities are related by a view link which link the master and detail view objects. i have a need to create/insert a master row and a detail row programmatically "on the fly" so that when the jsp renders, the user will see blank inputs for both the master and detail view objects. The problem is that the primary key of the master record is not known at creation time ( it will be entered by the user) and therefore the detail record cannot be created by the framework because of the unknown value of the parent's primary key. I was hoping the following section in the adf guide would eliminate my problem, but it doesn't appear to:
    This is from section 26.7.3.2 of the adf developer's guide
    Note: An alternative to the programmatic technique discussed
    above, which solves the problem at the J2EE application layer, is the
    use of deferrable constraints at the database layer. If you have control
    over your database schema, consider defining (or altering) your
    foreign key constraints to be DEFERRABLE INITIALLY DEFERRED.
    This causes the database to defer checking the constraint until
    transaction commit time. This allows the application to perform DML
    operations in any order provided that by COMMIT time all appropriate
    related rows have been saved and would alleviate the parent/child
    ordering described above. However, you would still need to write the
    code described in the following sections to cascade-update the foreign
    key values if the parent’s primary key is assigned from a sequence.
    This approach did not help in allowing me to create the detail record without first knowing the value of the parent's primary key record in a composition relationship. The only thing i've found to work is define the relationship as just an association, and not a composition. However, this is a true one to many (composition) relationship and i would like to take advantage of some of the features of the framework that are there when a relationship is defined as a composition relationship. Is there any way to do what i need to do with a composition relationship defined between these two entities? Thanks.

    Hi,
    I guess you need a "Cascading LOVs".
    1) Create viewObject for country values list. Named VO1.
    2) Create viewObject for state values list. Named VO2.
    3) Create view criteria for (bind variable) VO2 which can restrict the result by country.
    4) Create view accessor to get VO1.
    5) Create view accessor to get VO2. Define the bind variable value which can provide country info dynamically. I guess it should be a Groovy expression.
    6) Create country LOV on step 4) view accessor.
    7) Create state LOV on step 5) view accessor.
    Done
    On the view layer, you may enable PPR between country and state attributes.
    Todd

  • Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM

    Hi:
    I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
    form trigger key-commit code is is somehow like this:
    DECLARE
    tot_line NUMBER (3);
    line NUMBER (3);
    begin
    IF NAME_IN ('system.form_status') = 'CHANGED'
    THEN
    GO_BLOCK ('DETAIL');
    LAST_RECORD;
    tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
    FIRST_RECORD;
    line:= 1;
    LOOP
    :detail.quant := :detail.quant + 1;
    EXIT WHEN line= tot_line;
    next_record;
    line:= line+ 1;
    END LOOP;
    FIRST_RECORD;
    GO_BLOCK ('MASTER');
    END IF;
    COMMIT;
    end;
    The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
    But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
    Anyone help?
    Joao Oliveira

    Use PRE-UPDATE trigger (Master block).
    begin
    update <detail_table>
    set quant + 1
    where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
    and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
    and <detail_block_WHERE>;
    EXCEPTION WHEN OTHERS THEN NULL;
    end;

  • [Master-Detail] JBO-35007: Row currency has changed since...

    Hi,
    I have a very annoying problem in ADF Faces with row currency:
    I have a "Master table - Detail table" relationship on a very simple test page based on the SRDemo's PRODUCTS and SERVICE_REQUESTS tables. Everything was done automatically: create Entities from Tables, create the SLSB facade, and create the tables on the page via dragging the accessor.
    Then I added a "Refresh" button on the page whose action handler is:
        public String btnRefresh_action() {
            DCIteratorBinding iterMaster = (DCIteratorBinding)bindings.get("findAllProductsIter");
            String rowKeyStrMaster = iterMaster.getCurrentRowKeyString();
            DCIteratorBinding iterDetail = (DCIteratorBinding)bindings.get("serviceRequestListIterator");
            String rowKeyStrDetail = iterDetail.getCurrentRowKeyString();
            iterMaster.executeQuery();
            iterMaster.setCurrentRowWithKey(rowKeyStrMaster);
            iterDetail.setCurrentRowWithKey(rowKeyStrDetail);
            return null;
        }And here's where the problem kicks in:
    1. I select the product with ID=100 (because it has multiple details).
    2. I select some detail. Say, the second one.
    3. I click on the "Refresh" button.
    4. The button's handler re-executes the iterator and restores the current rows on the tables. The page loads okay and the rows that were selected prior to clicking on the button continue to be selected appropriately.
    5. Now I click on the "Refresh" button again. And I get the error: "JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]".
    Please, help. What should I do to prevent this error from happening? It it a bug in my code or a bug in the framework? When I only have one table (and not a Master-Detail relationship), everything works. The problem comes from the Detail table.
    We use EJB3 + JPA + ADF Faces. I tested the problem on JDev 10.1.3.3.0.4157 and JDev 10.1.3.2.0.4066.
    Best regards
    Bisser

    no post......
    Edited by: BaiG on Nov 2, 2010 2:21 PM

Maybe you are looking for

  • How can I read, millions of records and write as *.csv file

    I have to return some set of columns values(based on current date) from the database (could be million of record also) The dbms_output can accomodate only 20000 records. (I am retrieving thru a procedure using cursor). I should write these values to

  • How can I purge and delete OFFILES FOLDER

    Hi , I have groupwise 7.0 version. and I have 1 volume with 100 GB used... and the OFFILES Folder takes most of the space, how can I reduce this folder and not affect the mail system.. I will waiting for your comments.. Regards.. Roberto Tamez

  • How do I connect my Mac Desktop to my work windows

    how do i connect my Mac desktop computer to my work windows computer

  • Exception Handling in bounded taskflows - expected behaviour

    Hi, I'm currently reviewing exception handling in bounded task flows and some things does not seems to be very clear for me. (q1) Does it make sense that a bounded task flow calls a method (via a method activity) defined on the page definition of ano

  • Web upload via ImageMixer 3 Launcher

    I have a canon vixia hf m301. I could not  to do web upload via ImageMixer 3 Launcher. Windows XP explorer could see sd card but the software could not see it. What to do next? Thank, cherngchai