3 Levels Master Detail View Object with Java class interface

Hi Developers,
I've created 3 tables with one to many relations as below
BOARD ------<- APPLICANT ------<- QUALIFICATION
a board includes many applicants and an applicant includes many qualifications.
When I add these tables to a Fusion Project, JDeveloper 11g helps me to add the Entity Links and View Associations automatically.
Then, I defined these relations in an ApplicantModule's Data Model as below.
[+] BoardVO1
      |
      |--[+] ApplicantVO1
               |
               |--[+] QualificationVO1The problem is: I cannot write any function in QualificationVO and publish it by client interface.
I created a simple function with a single line (System.out.println(...) ) in QualificationVOImpl.java. and selected it in Client Interface. But when I execute it from the ApplicantionModel for testing, an oracle.jbo.NoObjException JBO-25003 is raised. with message: Object ... ApplicantVO1 of type ApplicationModule not found.
Has anyone tried to implement some coding in the third level of a master details view structure as my example? How do you make it works?
I'm using JDeveloper 11.1.1.3 with ADF BC.
Regards,
Samson Fu

Samson,
Looks like a bug (probably with the application module tester). I created your tables:
create table board(board_id number primary key not null);
create table applicant(applicant_id number primary key not null, board_id number not null);
create table qualification(qualification_id number primary key not null, aplicant_id number not null);
alter table applicant add a_fk foreign key(board_id) references board;
alter table qualification add q_fk foreign key(aplicant_id) references applicant;I created a JDev project and got the same results. I've e-mailed a test case off to Frank.
Frank - the method is indeed exposed on the VO instance, and I tried testing that way, but the AM tester gives the error as if it is looking for an AM instance with the VO's name.
John

Similar Messages

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • How to expose master-detail ViewObject of AppModule to service interface.

    Hi all,
    There is two VOs(master-detail), One is deptmentVO and the other is emloyeeInDeptVo. and a view link between departmentVO and employeeInDeptVO, the relationship is master detail.
    Now, I want to expose the custom method to web service, i.e createEmployee(EmployeeInDeptViewRowImpl employee).
    I perform the steps in Fusion ADF guide(+11.2.6 How to Support Nested Processing in Service-Enabled Master-Detail View Objects+).
    such as generate the SDO, and set the SERVICE_PROCESS_CHILDREN=true of the viewlink property.
    But when I publish the method in service interface, I cant get operation of the nested VO(employeeInDeptVO), only the master ViewObject is available.
    Any one have suggestions on this.
    Thank in advance.

    I have a similar scenario, and I'm seeing the same thing. The detail view isn't available for selection in the edit "Service View Instances" dialog of the "Service Interface" tab of the related application module. In my case, I have a view link based on an association that is rooted in a foreign key relationship between the underlying DB tables. The view link includes accessors in both the master and detail views. Based on the developer guide, I should be able to service enable the detail view, but this doesn't seem possible. My master view is service enabled, but my detail view isn't.
    Has anyone ever successfully service enabled a detail view in a master-detail relationship?
    Thanks

  • Displaying a Master with two detail view objects

    Hi,
    I have a situation where I need to relate a Master view object to two Detail view objects. Currently I am doing the lookup manually (using viewcriteria!) but I would much rather have the framework handle this. Does anyone know of a way to A: Link two details to one master and B: Display them on the same page.
    I am using Jdeveloper 9.0.3.3 (1205) and currently have a straight BC4J/JSP application with no struts or UIX.
    Thank you in advance for any help you can provide

    If I understand you correctly. You should just have to create two separate viewLinks. Add the datasource tags for the master and the two views via the viewlinks. Then use a rowKey to get the correct master.
    Hope that helps!

  • Performance Problem with Master-Detail Views

    Hi,
    I have developed a JSP-Applikcation with the master-detail views.
    I would like to report a bad performance at fetching data records from the detail view, because all records
    from master view have firstly to be retrieved to locate right row (rangesize="-1"). The number of records in
    the master table ist 2500 and 7000 in detail table.
    ============= Code Snippets (See HOWTO:Navigate using Data Tags of J. Oropeza) =====
    <jbo:DataSource id="dsMaster appid=testAppId viewobject="MaterView" rangesize="-1">
    <jbo:RefreshDataSource datasource="dsMaster">
    <jbo:Row id="msRow" datasource="dsMaster" action="Find" rowkeyparam="RowkeyValue">
    <jbo:dataSource id="dsDetail" appid="testAppId viewobject="DetailView">
    ======================================================================
    When rangesize="20" sets, performance is good, but the right row location of master view ist not found if the row
    is not positoned in this range (No data from detail view object are displayed).
    How can I improve the performance?
    Many thanks for your help.
    regards,
    Yoo

    Sung:
    Thank you for your suggestion.
    According to your suggestion I have changed my BC4J/JSP-application. However, the performance ist still bad.Whenn I click on a row retrieved from the master view, it takes 15 seconds until the associated data in detail view will be displayed on the other window (The application has been deployed on the test system of ISP).
    In an other case with much less data (162 master and 228 detail rows), it takes only 2 seconds (The application
    goes with the local server and DB of our company).
    ======================== master.jsp =================================
    <jbo:DataSource id="dsMaster appid=testAppId viewobject="MaterView" >
    <a href="detail.jsp?RowKeyValue=<jbo:ShowValue datasource="dsMaster" dataitem="RowKey"/>">
    Here Click
    </a>
    ======================== detail.jsp ======================================
    <jbo:DataSource id="dsMaster appid=testAppId viewobject="MaterView">
    <jbo:RefreshDataSource datasource="dsMaster">
    <jbo:Row id="msRow" datasource="dsMaster" action="Find" rowkeyparam="RowkeyValue">
    <jbo:dataSource id="dsDetail" appid="testAppId viewobject="DetailView">
    How do you think of this coding (My application is based on the document How to of J. Oropeza)?
    How can I increase the performance independently of the number of rows?
    Many thanks for your help.
    regards,
    Yoo

  • Should I start with Entity Object or Java Class Diagram ??

    Hi,
    I come to J2EE / OO application development from non-oo programming world. I am still confused about what step-by-step development approach should I take ?
    Should I :
    - start with creating Entity Object from available database table ?
    - should I start with Java class diagram, followed by generating database tables, then create EO from it ?
    Could anybody please help me, what best practice step by step development approach should I take ?
    Is there any white paper / docs about this ?
    Thank you for your help,
    Krist

    Krist,
    If you are not from the OO world then you may be interested in this new site on OTN (http://otn.oracle.com/formsdesignerj2ee) There is a workshop that starts by looking at an existing datamodel and builds up from there.
    If you are starting from nothing, you can indeed start higher at the Class Model level.
    I recently started discussing data modeling on my blog (http://www.groundside.com/blog/content/SueHarper/) and there are some very good comments(feedback from readers) that may possibly be useful to you.
    If you are new to the UML modeling world, I recommend you read two very good papers by Jan Kettenis on OTN (http://www.oracle.com/technology/products/jdev/collateral/collateral10g.html) They are Getting Strted with UML Class modeling and Getting Started with UML Use Case Modeling.
    Shay pointed you to Toplink. There are a lot of resources on OTN for Toplink, including tutorials.
    Personally? I think if you have time, and if you can, start with a Class Model and perhaps a Use Case model, then you can start planning your application development from a solid base.
    Regards
    Sue Harper

  • 3 Level Master-detail-detail data view implementation

    Hi OAF Gurus,
    I have a requirement, where in I have to show a 3 level master-detail relationship data on a page. Is it possible to implement a master-detail-detail table structure i.e. table-in-table-in-table view. I have done table-in-table ( a 2 level or master-detail ) structure before, but I am running out of ideas on this one. Below is the requirement.
    I have queryBean for a customer search, then when searched by a customer, I get the Customer search results in a table below. Then I need to show Customer Sites in an inner table and then in another inner table on the Customer Sites, I need to show the customer contacts, something like this below.
    + Customer Name, Customer Acct.Number ....
    + SiteId , Site Name, BillTo, ShipTo
    + ContactName, Contact Address, Contact Phone Number
    Hope you can provide me some ideas. I appreciate all your help. Thanks again.

    Anyone any ideas, please let me know. This is really urgent. Please let me know if there is any way we can do this, other than going to a new page. Appreciate your feedback.
    Thanks.

  • URGENT HELP PLS :  Issue with Multi Level Master Detail block

    This is an issue someone else had posted in this forum few years back but there was no solution mentioned, I have run into this same issue , The problem is as explained below.
    Any help on this is appreciated.
    Scenario:
    There are 3 Blocks in the form : A (Master Block)
    : B (Detail of A )
    : C (Detail of B )
    There is master detail relation created between A and B and B and C. So initially when we query for a record in Master A, it shows all records properly in B and C.
    Now if i navigate to the first record of B , and then second record of B , records corresponding to that record shows up properly in C block.
    Till now everything works fine.
    Issue 1:
    But in case after querying initially on Master Block A,If I go directly to the second record of B block, it clears the whole B block and C block.
    Issue 2:
    Same thing happens if I am on C block ( corresponding to second record of B block) and then navigate to first record in B block , it again clears the whole B block and C block.
    Please Help !!
    Thanks !

    Thanks Xem for Your reply , I tried those settings but it did not help..here is the original link that to the thread that talks about the same problem ,
    Issue with Multi Level Master Detail block
    The last update to this was the following :
    "I figured out that this is happening because Block Status is set to 'Changed' and this is causing it to clear out the blocks.
    But cant figure out why the status is setting to 'Changed' "
    Any Help from the form Gurus on this form in this matter is truely appreicated !!
    Thanks,
    Zid.

  • Post-generating 3-level master-detail-detail screens

    Hi all,
    for a consulting project, I had to create several three-level master-detail screens using JHeadstart. For the JHS demo app, this would mean for example that a location page contained a list of departments at the location and underneath it a list of employees working at the currently selected department.
    From what I have learned so far using JHS, this is not supported by the wizards and should be done by post-generation changes. This forum has a few topics mentioning the problem and possible solutions, but most of the time just fragments of the complete solution/approach. As I had to create several of these 3-level detail screens, I tried to uniformly document them, providing the 7-step guide as outlined below. I only started working with JHS recently, so please let me know where I take a long way round or where my approach is not appropriate at all :o)
    NOTE1: Terminology-wise, for the example given above, I will call the departments the 2nd level detail and employees the 3rd level detail, while locations are the first level masters. I hope this is not too confusing ;o)
    NOTE2: the example code is not guaranteed to work with the JHSdemo. I just changed the names of variables and classes from my own application to the familiar entities of the demo.
    STEP 1: Generate plain MD screens for the first and second level entities (table-form) using the JHS application generator and make sure all generated features you want in your page are OK. Afterwards, switch off the UIX generation in your application structure file. If you want multiple entities at the third detail level,
    STEP 2: Add the functional contents of the generated 3rd level detail UIX page to the main master UIX page, right underneath the 2nd level detail-table but still inside the <header> entity of this 2nd level detail. (I'm not too sure whether this really matters, but at least the indentation looks nice). What I call "functional contents" is the <header> entity containing the 3rd level detail table.
    STEP 3: Edit the java file of the 3rd level view object, adding a variable storing the identifier (primary key) of the currently selected 2nd level detail row. If you haven't used the java file before, generate it by doubleclicking the view object and checking the generate view object box in the Java screen.
    private String $selectedDeptID;
    public void setSelectedDeptID(String id) {
    $selectedDeptID = id;
    STEP 4: Edit the java file of your application module (in the model layer) and add a method for updating the view objects search queries like the example below:
    public void updateEmployeeView(String deptID) {
    // fetch the view object instance
    EmployeeViewImpl view = (EmployeeViewImpl)this.getEmployeeView1();
    // register the currently selected departments ID
    view.setSelectedDeptID(deptID);
    // re-execute the view objects query
    view.executeQuery();
    // reset the selected ID
    view.setSelectedDeptID(null);
    STEP 5: Create a java class for handling the event when a user selects a different 2nd level detail row.
    package view;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import oracle.adf.controller.struts.actions.DataActionContext;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.bc4j.DCJboDataControl;
    import oracle.adf.model.binding.DCDataControl;
    import oracle.adf.model.binding.DCUtil;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.ui.data.PageEventFlattenedDataSet;
    import oracle.cabo.ui.data.DataObject;
    import oracle.cabo.ui.data.DataSet;
    import oracle.cabo.ui.beans.table.SelectionUtils;
    import oracle.jbo.ApplicationModule;
    * USER-DEFINED EVENT-HANDLING CLASS
    * this class is triggered after the user selects another row in the Department
    * table/form in the Locations.uix screen. It derives the ID (pk) of the
    * selected row and launches the AppModule method to update the view objects
    * select queries with the selected DeptID.
    public class RowSelector
    * private variable holding the name of the DataControl module for this
    * Application Module
    private static final String DATACONTROLNAME = "AppModule" + "DataControl";
    * private variable holding the name of the table/form object in the uix page
    * from which we want to derive the selected row data.
    private static final String TABLEFORMNAME = "DepartmentsView2";
    * private variable holding the name of the form field holding the database
    * ID (pk) of a row in the ${TABLEFORMNAME} table/form
    private static final String IDFIELDNAME = "Dept_ID";
    * This method fetches the ID of the user-selected row in the DepartmentsView2
    * table/form in the Locations.uix form.
    * Afterwards, it fires the ApplicationModule method for updating the view objects
    public static EventResult doSelectionEvent(BajaContext bc, Page page, PageEvent event)
    try {
    // create a new FlattenedDataSet for the table name
    DataSet tableInputs = new PageEventFlattenedDataSet(event, TABLEFORMNAME);
    // fetch the UI table index from the DataSet (NOT the pk from the db)
    int index = SelectionUtils.getSelectedIndex(tableInputs);
    // fetch the DataObject representing all the input elements on the current table row.
    DataObject row = tableInputs.getItem(index);
    // fetch the value of the input field holding the ID (pk) of the selected department row
    Object value = row.selectValue(null, IDFIELDNAME);
    if (value != null) {
    // tell the AppModule to update the appropriate view object(s)
    getAppModuleImpl(bc.getServletRequest()).updateEmployeeView(value);
    // quick and dirty exception handling. not too many exceptions possible due to
    // hard-coded field/table/module names. anyway, taking no action at all is not
    // that bad an option for a demo ;o)
    } catch (Exception e)
    e.printStackTrace();
    return null;
    * method for fetching the active Application Module
    public static AppModuleImpl getAppModuleImpl(HttpServletRequest request)
    BindingContext ctx = DCUtil.getBindingContext(request);
    DCDataControl dc = ctx.findDataControl(DATACONTROLNAME);
    AppModuleImpl service = (AppModuleImpl)dc.getDataProvider();
    return service;
    STEP 6: Override the executeQueryForCollection method in your view object java file to make sure it uses the selected 2nd level detail rows ID for the bound variable specifying the 3rd level select query. Otherwise, the select query for the 3rd level detail set appears to use the ID of the first 2nd level detail row selected for the currently selected 1st level master. In the example below, no other bound variables are used in the view object, otherwise, the indexing might have to be adjusted.
    protected void executeQueryForCollection(Object qc, Object params[], int noUserParams) {
    if ($selectedDeptID != null) params[0] = $uur;
    super.executeQueryForCollection(qc, params, noUserParams);
    STEP 7: In the Locations.uix page, set a primaryClientAction for the radio select input in the 2nd level detail screen. This action should fire an event (fe 'userChoseDepartment') and refresh the 3rd level detail tables using the partial refresh options in the primaryClientAction dialog window. Afterwards, add an event handler to the bottom of your Locations.uix page, linking the event specified before to the doSelectionEvent in the RowSelector class.
    So, that's how it worked for me. I hope it does the same for you and please do post any comments or remarks if problems arise or simplifications are possible. The more remarks or bugs appear in the above code, the more the JHS team is hinted to enable auto-generated 3rd level detail screens :-D
    Cheers,
    benjamin

    Benjamin,
    Thank you for sharing your expreinces with us!
    A few remarks:
    1. With JHeadstart 10.1.2.1 you can generate unlimited master-detail levels in the same page when using UIX and table-layout for the detail groups This feature is implemented usin g UIX table detail disclosure: when you click on the "show" link in a row in of the level 2 detail table, you will see in the detail disclosure area the level 3 detail table.
    There is a screen shot of this feature in the JHeadstart Developers Guide for 10.1.2.1, chapter 3, section "Creating Table Pages". You can now download the dev guide from the JHeadstart Product Center:
    http://www.oracle.com/technology/consulting/9iservices/jheadstart.html
    2. You have a lot of steps related to synchronizing the level 3 ViewObject with the level 2 ViewObject. You can leave all this work to ADF Business Components, by adding the l;evel 3 ViewObject as a nested usage to the level 2 ViewObject in your application module data model.
    Ths would save you the work you aredoing in steps 3 to 6.
    Steven Davelaar,
    JHeadstart Team.

  • Possible bug when creating multiple detail view objects

    using jdev 11.1.1.0.0 to build jsf/adf applications. I wanted to report what seems like a bug in 11g. I have a parent table which has two child tables. After creating the appropriate entities, associations, views, and view links, the app module looks like this:
    MasterView
    --DetailView1
    --DetailView2
    The two detail view objects are on the same level, they are both direct children of the Master view.
    Here's what's happening:
    1) I create the master entity/view objects (MasterView)
    2) I create one of the detail entity/view objects (DetailView1).
    3) I create the association and view link to establish relationship between MasterView and DetailView1. Everything works fine.
    4) I create the entity/view objects for second detail view (DetailView2)
    5) When I attempt to create a second view link (based off an association) to establish the relationship between MasterView and DetailView2, the query clauses of the Create View Link wizard (screens 4 and 5) do not get created properly. I finish the wizard and save. Not only does this view link not get created properly, but in the process the query clauses that were defined in the first view link between MasterView and DetailView1 are wiped out. This will break any coordination between master and detail views in both the app module tester and runtime. Has anyone seen this problem?

    fyi, it looks like this issue has been resolved with jdev 11.1.1.0.2 (Update 2)

  • Use View Object with Alternative Data Sources in View Link

    In my case, I created a view object based on alternative data source (not with SQL query). I have setQuery(null) in the override create() function for this View Object. When I use this View Object at the destination end of the View Link, the setQuery(null) will raise Jbo-26016 exception (You cannot set customer query (calling setQuery()) on a view object if it is the detail view object in a master detail view link.) which does not allow me to do that. I looked Avrom's Framework for Database API-Based ADF BC, in which he override the DBTransaction and CallableStatement in order to intercept the default query clause set by the View Link. I'd like to see if there is any alternative ways to achieve my objective?

    Just following up what I found so far. I'm trying to use customized View Object based on alternative data source at the destination end of View Link with ADF 10.1.3.
    1. For the View Object at the destination end of View Link, I can not call setQuery() which will raise Jbo-26016 exception.
    2. I can omit the setQuery(null) call in my customized ViewObjectImpl, and as long as there is no SQL statement in the View Definition XML, it won't cause problem when calling the executeQueryForCollection() of the super class.
    3. The override executeQueryForCollection() must call the super.executeQueryForCollection() in order to get appropriate result (I tried to skip the call and it does not give back any results)
    4. The funny thing is, when I make getQuery() call in my customized ViewObjectImpl (I'm just trying to double check if the Query object is clean or not), the query object is set to "SELECT FROM" following the getQuery() call, and which causes the exceptions when I call super.exeuteQueryForCollection(). I found out later from the Javadoc API which is implemented in that way.
    So I guess my case is resolved by not making specific call to setQuery(null).

  • Inserting a new row in a BC4J View Object with an attribute of type BFileDomain

    Hi all,
    I've to insert a row in a View Object with an attribute of type oracle.jbo.domain.BFileDomain.
    I do this within an Application Module's method, which has an input parameter of type byte[]. This parameter will be the content of the BFILE.
    What's the right way for doing that?
    I've tried with the following code, but I've got an exception in committing the transaction:
    public int serializeDocument(int codDomanda, int codSorgente, byte[] content, String est, int type, int cost, String title, String arg) throws JboException {
    int code = 0;
    //File f;
    DocumentiTwoView = getDocumentiTwoView();
    java.sql.Statement stmt = ((DBTransaction) getTransaction()).createStatement(1);
    try {
    Row docRow = DocumentiTwoView.createRow();
    SequenceImpl seq = new SequenceImpl("documenti_seq", getDBTransaction());
    Integer next = (Integer) seq.getData();
    code = next.intValue();
    docRow.setAttribute("Coddocumento", new Number(code));
    docRow.setAttribute("Titolo", (String) title);
    docRow.setAttribute("Argomento", (String) arg);
    docRow.setAttribute("Costo", new Number(cost));
    docRow.setAttribute("Tipo", new Number(type));
    docRow.setAttribute("Coddomanda", new Number(codDomanda));
    docRow.setAttribute("Codsorgente", new Number(codSorgente));
    //f = new File("Doc" + code + "." + est)
    BFILE src_lob = null;
    ResultSet rset = null;
    rset = stmt.executeQuery ("SELECT BFILENAME('DOC_DIR', 'Doc" + code + "." + est + "') FROM DUAL");
    if (rset.next()) {
    src_lob = ((OracleResultSet)rset).getBFILE(1);
    BFileDomain bfd = new BFileDomain(src_lob);
    bfd.setBytes(content);
    bfd.saveToDatabase(getTransaction());
    docRow.setAttribute("Contenuto", (BFileDomain) bfd);
    catch (Exception ex) {
    getTransaction().rollback();
    throw new oracle.jbo.JboException("Impossibile creare il nuovo documento:\n" + ex.getMessage());
    finally {
    try {
    stmt.close();
    catch (Exception nex) {
    try {
    // Commit the whole transaction
    getTransaction().commit();
    catch (Exception e) {
    e.printStackTrace();
    getTransaction().rollback();
    throw new JboException("Impossibile eseguire il commit della transazione:\n" + e.getMessage());
    return code;
    Thanks a lot in advance!
    Christian
    null

    Odd, have you disabled caching and indirection? (NoIdentityMap, dontUseIndirection, or alwaysRefresh/disableCacheHits). If so, then this could be the issue.
    Otherwise please include the sample code you use to perform this, and verify that you do not have any unusual code in your set/get methods or in descriptor events. Also turn TopLink logging on and include a sample. Also ensure that you do not modify your objects until after registering them in the unit of work, and only modify the unit of work clones.

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • Date validation in a master/detail view

    Hi everyone,
    I have a problem and I hope someone can help me. I'm trying to create a validation for my application. I have a Master/Detail view where I add rows to my database and in the rows there is a "from date" and "to date". I want to create a validation so that the "from date" can not be chosen before the current date.
    I'm having trouble because most of the tutorials I read on this work with page items, but since I have this in a Master/Detail view I have Column Attributes, wich do not behave the same way as page items.
    Any help would be very appreciated.
    Thanks,
    Luka

    I'm still having quite some trouble with this... everything I try gives me some sort of error.
    My latest attempt was to make a PL/SQL returning boolean validation with the code:
    FOR i IN 1..APEX_APPLICATION.G_F10.COUNT LOOP
    IF DATUM_OD(APEX_APPLICATION.G_F10(i), 'DD.MM.YYYY HH24:MI') < SYSDATE THEN
    return true;
    else
    return false;
    END IF;
    END LOOP;
    and it says:
    Error processing validation.
    ORA-06550: line 2, column 4: PLS-00201: identifier 'DATUM_OD' must be declared ORA-06550: line 2, column 1: PL/SQL: Statement ignored

  • Master/Detail Viewer Application in Web Dynpro ABAP

    Hello @ll,
    i search a Master/Detail Viewer Application in Web Dynpro ABAP like this in WEB Dynpro Java (show below).
    http://help.sap.com/saphelp_nw04/helpdata/en/84/8bc1a36a38da41a46517b114ca0974/frameset.htm
    Have anyone a tutorial or can help how i config the event "onLeadSelect".
    I create a master- and detail table done all context mapping.
    Thanks in advance
    regards
    armin

    Hi Armin,
    Please go through
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7a89b067-0801-0010-8192-a9896a60938e?quicklink=index&overridelayout=true
    Thanks,
    Prahsant

Maybe you are looking for

  • Adding a new field to the Address Data for a business partner

    Hi Experts, I am trying to add a new custom field to the address data (all structures and tables) that is linked to a business partner on SAP CRM via EEWB. Structure is the address structure wthin BUS_EI_EXTERN. Table is BUT020. I have been told that

  • What is KCV (Key Check Value) in 3DES used for?

    Hi Friends.. I want to know what is KCV (Key Check Value) used for?.. i found that 3DES operation (2Keys length or 3Keys length) sometimes needs KCV (Key Check Value).. As far as i know the KCV itself computed as Follows : 3DES(Keys, IV(all zeroes),

  • How to default  Sending CostCentre in Timesheet

    Dear Freinds,                  I have to default values for the Activity type and Sending Cost center. I have used the USER exit CATS0002 . But this is not surving the purpose , this is working if iam entering the no of hours and press enter then the

  • Personnel Development - View Assignment

    Hello, Using Personnel Development/Performance Management, I am trying to assign a View to the rest of the managers, rather than just my specific user.  Is there an easy way to accomplish this?  When I save a view, only User is available in the Assig

  • Good back-up system?

    Anyones input would be cool. I am thinking of getting a bottom of the line Mac Pro solely for back-up purposes only. I'll be purchasing extra drive chassis for each drive I have so they would be easy to install and take out and store. Do you think th