Filter master rows based on attributes in detail view.

Hi,
How do I set up VO's so that I can:
1. filter master records based on attribute values in either the detail or master attribute values.
and
2. display each distinct master record with all its associated detail records.
Stated another way, I want to list all the master records (with their associated detail records) filtered by the existence of qualifying detail records -- give me all departments which have assigned one or more employees who meet some criteria; list the departments and ALL the dept.'s employees (regardless of whether they individually meet the criteria).
We've been struggling with this for a couple of weeks. I've been trying to accomplish this on 10.1.2, 9.0.5.2 and 9.0.3.3 with pretty much the same results on all three versions.
To make queries based on values in either the master or detail records we created a database view that denormalizes the tables. This let's us include criteria based on either the master or detail tables, but of course rows from the master table may appear multiple times. We tried a DBMS global temporary table, but the inserted rows were not visible to the client; I'm assuming they're discarded with the session between queries or the queries establish separate sessions. I tried marking only the master record columns as selected and queriable and the detail columns as just queriable, but this causes the detail columns to be defined as transient VO attributes.
TIA, for ideas or guidance.

Hi,
How do I set up VO's so that I can:
1. filter master records based on attribute values in either the detail or master attribute values.
and
2. display each distinct master record with all its associated detail records.
Stated another way, I want to list all the master records (with their associated detail records) filtered by the existence of qualifying detail records -- give me all departments which have assigned one or more employees who meet some criteria; list the departments and ALL the dept.'s employees (regardless of whether they individually meet the criteria).
We've been struggling with this for a couple of weeks. I've been trying to accomplish this on 10.1.2, 9.0.5.2 and 9.0.3.3 with pretty much the same results on all three versions.
To make queries based on values in either the master or detail records we created a database view that denormalizes the tables. This let's us include criteria based on either the master or detail tables, but of course rows from the master table may appear multiple times. We tried a DBMS global temporary table, but the inserted rows were not visible to the client; I'm assuming they're discarded with the session between queries or the queries establish separate sessions. I tried marking only the master record columns as selected and queriable and the detail columns as just queriable, but this causes the detail columns to be defined as transient VO attributes.
TIA, for ideas or guidance.

Similar Messages

  • LOV in a master row based on rows detail values

    Hi all,
    I am using Jdeveloper 11.1.1.2 and ADFBC.
    I have a masterTable and I want to associate a LOV on one of its field. The LOV is based on a field of the detailTable (linked to the masterRow). masterTable and detailTable are linked in this way: idMaster = idDetailToMaster
    I try to explain doing an example:
    I have rowMaster1 that has 3 rowsDetails and rowMaster2 that has 2 rowsDetails. When I select the rowMaster1, I would like to see in the LOV the 3rowsDetails associated to it, while when I select the rowMaster2, I would like to see in the LOV the 2rowsDetails associated to it.
    Now I have tried to do a simple LOV and I see all the 5 rowDetails repeated more times (it seems to me, one time for every row in detailTable).
    I think I have to filter data considering that I want the rows where idMaster = idDetailToMaster, but I don't know how to do.
    If is this the right way, can anyone explain to me how to do?
    Or if there is another solution, how can I do?
    Any help will be appreciated.
    Regards,
    Andrea

    Hi,
    try as follows
    - create a ViewCriteria for the Detail View
    - Have a bind variable that takes the masterId value
    - On the master, create a LOV and choose the detail VO and apply the VC
    - For the bind variable, just reference the name of the master attribute that ha sthe value to filter the detail view
    Frank

  • Searching master block based on value in detail block

    I have two blocks on a form. A master block for purchase orders and a detail block for the line items. I need to provide users with the ability to search the purchase orders based on the values entered into the detail block (line items), during the query entry. I am considering to check to see which block the cursor resides by using the :SYSTEM.CURSOR_BLOCK variable, then retrieving the value from the current item and running a query, using that query. The problem is that I am not very familiar with Forms and do not know how to implement my idea. Any ideas?
    null

    I copied you an example from metalink. Hope it will help.
    Doc ID:
    Note:109583.1
    Subject:
    How to query a Master record from a Detail Block
    Type:
    BULLETIN
    Status:
    REVIEWED
    Content Type:
    TEXT/PLAIN
    Creation Date:
    22-MAY-2000
    Last Revision Date:
    03-AUG-2001
    PURPOSE
    ------- To query a master record from a detail record. DESCRIPTION
    =========== The user would like to enter a query criteria in the detail block
    and then query the master record based on the above user input. SOLUTION
    ======== Create the master and detail blocks and the relationship in the usual
    manner. We will consider here the blocks DEPT and EMP based on the
    SCOTT schema. 1. Create a KEY-ENTQRY trigger at the block level of the detail block
    (EMP) and add the following code in it : GO_BLOCK('dept');
    CLEAR_BLOCK(no_commit);
    GO_BLOCK('emp');
    ENTER_QUERY; 2. Create a KEY-EXEQRY trigger for the detail block and add
    this : EXECUTE_QUERY;
    :global.deptno := :emp.deptno;
    :global.flag := 'T';
    GO_BLOCK('dept'); This will store the value of the deptno (primary key) in a global variable
    :global.deptno and set another global variable :global.flag to 'T'. This
    will be explained as we progress. 3. Create a WHEN-NEW-RECORD-INSTANCE trigger for the detail block
    and add the following : -- This is used to populate the MASTER block with the corresponding
    -- record whenever the user navigates through all the records in the
    -- DETAIL block if get_record_property(:system.cursor_record,:system.cursor_block,status) = 'QUERY' then
    SELECT rowid,deptno,dname,loc
    INTO :dept.rowid,:dept.deptno,:dept.dname,:dept.loc
    FROM dept
    WHERE deptno = :emp.deptno; -- This is to set the status of the record populated
    -- to QUERY and not to create a new record SET_RECORD_PROPERTY(1,'dept',status,QUERY_STATUS);
    end if; 4. Create a WHEN-NEW-BLOCK-INSTANCE trigger for the master block again
    and add this : if :global.flag = 'T' then -- set the variable to a different value
    :global.flag := 'F';
    :dept.deptno := :global.deptno; -- This will query the master table for the record based on the
    -- deptno of the detail table which is stored in :global.deptno -- For ex: if an employee of department 10 has been queried in
    -- the detail, then the global.deptno will have the value 10,
    -- which is used in the query below to fetch the master record. SELECT rowid,deptno,dname,loc
    INTO :dept.rowid,:dept.deptno,:dept.dname,:dept.loc
    FROM dept
    WHERE deptno = :global.deptno;
    set_record_property(:system.cursor_record,'dept',status,QUERY_STATUS);
    GO_BLOCK('emp'); end if; EXPLANATION
    =========== Actually in the above method we are using the base table blocks as a
    non-base table block when we query the master from detail. We are
    displaying the master record fetched from the table based on
    the query supplied in the detail. So after the fetch, if we clear the
    block or form then we get a "Do you want to save the changes you have made"
    alert. So in order to supress this while entering a normal master-detail
    query, we have created the global variable, :global.flag. There is a limitation though, if you query detail records and then
    navigate to the master block and then press the down arrow( i.e.,
    navigate to the next record) and then presses the up arrow to
    navigate back to the same record, then the detail records that
    were originally populated will change and a new set of records will
    get displayed. This is because the normal master-detail query is
    taking place during MASTER record navigation. This can be controlled by creating a flag (global variable) and setting
    its value and thus preventing the user from navigating to the next master
    record. Do the following : 1) In the KEY-EXEQRY trigger of the detail add the following :global.control_master := 1; 2) Create a KEY-EXEQRY for the master and add this : :global.control_master := 0;
    EXECUTE_QUERY; 3) Create a KEY-DOWN in the master with the following in it: IF :global.control_master <> 1 THEN
    down;
    END IF; Declare all the global variables before running the Form. RELATED DOCUMENTS
    Note:611.1

  • No TITLEs displayed in Detail view in Windows Explorer

    The following pertains to Windows 7 Professional 64-bit vs. Windows XP Professional 32-bit.
    In Windows Explorer, when viewing the file list in 'detail' view, you can also add the 'title' attribute for display by right-clicking the attribute bar above the file list.  However, in Windows 7, no titles are displayed for PDF files that have this
    information which were displayed under WinXP.  Also, if the file properties are displayed, the PDF tab is gone.
    I cannot find any info on how to re-enable this feature.  If XP-style PDF title attributes have been removed or disabled in Windows 7 Explorer, it is a MAJOR omission for our corporation.  We have a massive collection of corporate
    and 3rd party PDF documents where interdocument links will not work if the filename is changed.  The TITLE attribute in detail view is used to display the document title, not the filename.  If any other view is used, e.g. icon view, the bubble
    popup displays the title in WinXP, but this again doesn't work in Win7.  Without the title attribute working as it does in XP, we may have to forego moving from XP to Windows 7 on our desktops (we're skipping Vista, of course), and find an alternate
    desktop OS (Linux?) that still supports this feature.
    For example, every IBM software/hardware PDF manual has a cryptic filename which does not reflect anything about the title of the manual.  These filenames support inter-manual links, so renaming the PDF manuals to reflect the title is absolutely
    not an option.  However, the PDF attributes of the file do contain the title, and these were visible under both Properties (the PDF tab), and the TITLE column in Detail view under WinXP.  However, both of these features are gone in Windows 7,
    and to say it's a PITA is a gross understatement.
    We want (need) this feature back in Windows 7.  I'd call it a show-stopper in moving to Windows 7 if this isn't fixed, and soon!
    Btw, Microsoft, we have over 45,000 desktops currently running WinXP, plus 100's of Win2003/Win2008 servers in our corp.  Are you listening?

    Here's what seems to be going on.
    As part of the Adobe Reader download, Adobe provides a shell extension called pdfshell.dll.  On 32-bit Windows XP, you'll find it in the C:\Program Files\Common Files\Adobe\Acrobat\ActiveX folder.  On 64-bit Windows 7, you'll find it in the C:\Program
    Files (x86)\Common Files\Adobe\Acrobat\ActiveX folder.  But, on either system, it's a 32-bit shell extension.  On 64-bit Windows 7, Windows Explorer will only run as a 64-bit program.  According to numerous web forum posters, this was a change
    between the last "beta" and the "RC" version of 64-bit Windows 7.  There is a 32-bit version of Windows Explorer in the C:\Windows\SysWOW64 folder, but if you try to run it you get another instance of 64-bit Explorer.  The (first)
    problem is that 64-bit Windows Explorer won't load a 32-bit shell extension.
    You can see the 32-bit pdfshell.dll "working" on 64-bit Windows 7 in the File Open dialog of any 32-bit application (such as Adobe Reader).  To see this, first open an Explorer window and navigate to a folder that has some PDF files like your
    IBM manual.  Right click on the file and choose Properties.  Look at the tabs in the dialog and note that there is no PDF tab.  Now, OK out of the Properties dialog and double-click on the same file to open it in Adobe Reader.  Now press
    Ctrl-O or choose File Open to get the File Open dialog.  Navigate to the same folder, right click on the same file and choose Properties.  Look at the tabs and see that you now have the PDF tab that was missing in Explorer.  In that tab, you
    can see the Title that pdfshell.dll has pulled from the file.  This works because 32-bit Adobe Reader has loaded a 32-bit common file dialog which *will* load a 32-bit shell extension.
    But you're not out of the woods yet.  The common file dialog has many of the features of Explorer, and you can select Details view and right-click on the column headers to choose to show a Title column.  This will show Titles for several document
    types, but not for PDF files.  This isn't a 64-bit versus 32-bit issues, it's a Windows XP versus Vista and later issue.  What Adobe implemented in pdfshell.dll is an ActiveX interface called IColumnProvider, and Microsoft dropped support for this
    interface in Windows Vista (replacing it with something called the Property System).  You can glance at http://msdn.microsoft.com/en-us/library/bb776831%28VS.85%29.aspx and just read the first line after the page header:  "[This feature is supported
    only under Windows XP or earlier. ]".  So, the PDF Title column feature didn't go away with 64-bit Windows 7, it went away with 32-bit Windows Vista.
    The best solution to this problem would be for Adobe to update pdfshell.dll to provide the Property System interface that Vista and Windows 7 require.  See http://msdn.microsoft.com/en-us/library/bb776859%28v=VS.85%29.aspx if you care for the details. 
    Then Adobe should release 32-bit and 64-bit versions of pdfshell.dll implementing the new interface, and we'd get both the PDF tab and Explorer columns like Title for PDF files in 32-bit and 64-bit versions of Windows 7 (and Vista).
    Alternatively, some enterprising developer could presumably write a shim that would present the Property System interface on its upper side (callable by Explorer) and the IColumnProvider interface on its lower side (capable of calling existing versions of
    pdfshell.dll).  It would need to deal with interfacing between 64-bit Explorer and a 32-bit pdfshell.dll ... I assume that this is possible somehow, but I don't know.
    A kludge that might be (barely?) usable would be to use Windows XP Mode to run a 32-bit Windows XP Explorer and use that to navigate using the PDF Titles and possibly launch them.  Perhaps you could come up with a way to make Windows XP Mode's Explorer
    launch Adobe Reader in the host 64-bit Windows 7 OS.
    A third-party solution might be xplorer^2 (http://www.zabkat.com/index.htm) which claims to support the interface that Microsoft dropped in Vista (http://www.zabkat.com/blog/07Feb10-column-handlers-revived.htm).  I know nothing about this program, I
    just found it while Googling for "column handler".  It says that it has a 21 day trial, is available in 32-bit and 64-bit versions and costs $29.95 (presumably US dollars).  There is a "lite" version that is free for non-commercial
    use ... all of this info is just repeated from their web pages, I have no connection to the company and only know what I read ... I haven't tried it.
    It's worth noting that life isn't perfect with pdfshell.dll and 32-bit Windows XP either, depending on your PDF files.  Some documents don't have Titles (depending, partly, on what software produced them).  Some have Titles long enough that they
    won't display in an Explorer column (though they show up truncated on the status line and un-truncated in a tooltip).  I have a file called "GEARaspi Security Information.pdf" (http://www.gearsoftware.com/support/GEARAspi%20Security%20Information.pdf)
    that has no Title, created by OpenOffice.org 2.4 according to its PDF tab.  I have another called "319124.pdf" (http://www.intel.com/assets/pdf/whitepaper/319124.pdf) which has the rather wordy title "Intel®  Extreme Memory Profile
    (Intel® XMP) supporting Intel® X48 Express Chipset with DDR3 White Paper".  Despite having a Title, no Title is displayed in a Title column in Windows Explorer in 32-bit Windows XP, though a truncated version appears in the status bar and
    the tooltip gets the whole thing, wrapping to two lines to do it.  Intel's file was produced with Acrobat PDFMaker 7.0 for Word according to its PDF tab.
    This post is based on what I could figure out, I hope it's helpful (if discouraging ... you won't fix this with a registry hack).

  • Add a Detail Table Row per master row

    Hi,
    I am currently working on a requirement for a master detail advanced table.
    I am trying to add one detail row per master row when the page loads based on the link between the two.
    I have a master table with 20 records and I need to create 1 detail row per master row....
    I have managed to create an add detail row button which works fine for single additions, but cannot seem to get the detail VO to add a row for each master row through the AM or CO.
    I have created a process to insert rows into the VO which based on debug statements seems to work, but nothing shows within the detail table.
    in the PR I run the query for the master, which in turn shows the detail row (Detail boolean is set to True).
    However any attempt to add it programatically does not seem to work.
    Any ideas appreciated.
    Patrick
    Edited by: patrickmburke on 10/10/2012 19:26

    Hi,
    Here's some more code :
    - The column in a default adf read only table :
                    <af:column headerText="Action / State">
                         <af:commandLink actionListener="#{bindings.setCurrentRowWithKey.execute}"
                                                  action="#{backingBeanScope.backing_page.validerRSP_action}">
                              <af:image source="/gfx/icon_valid.PNG"/>
                         </af:commandLink>
                     </af:column>- SetCurrentRowWithKey in page def
        <action IterBinding="ViewObject1Iterator"
                id="setCurrentRowWithKey5"
                InstanceName="AppModuleDataControl.ViewObject1"
                DataControl="AppModuleDataControl" RequiresUpdateModel="false"
                Action="setCurrentRowWithKey">
          <NamedData NDName="rowKey" NDValue="${row.rowKeyStr}" NDType="java.lang.String"/>
        </action>I haven't figure out the solution yet.
    Regards.
    Luc-

  • How to get a specific Row based on filter on a specific column value

    Friends,
    I have a requirement to fetch a row, maximum salary of an employee row from employee table using ADF View object, I have a view object with result set based on some critieria, now I have to get a row out of result set which is having maximum employee salary.
    Please put your thoughts or experiences!!
    Thanks

    You should be able to add a transient attribute called maxSalary and use groovy functions to find vo.max(Salary) like -
    https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in
    How to calculate ADF table column [check Laura Akel's post]Then you can create a view criteria which equates the salaryfield to maxSalary and returns just one row.

  • Get Rows based on  value of a certain Attribute

    Hi guys,
    i was trying to get all the rows from the cache as well as the Database for my VO
    For that i used getFilteredRows() as well as findByKey() method.
    But i could not get any rows.
    Also i had a doubt for the findByKey() method. Do we need to use Primary key as Key or do can we use any attribute as the Key?

    Hi Pradeep,
    I think getFilteredRows() works only after executeQuery() has brought the rows to cache. I do not know if getFilteredRows() runs executeQuery() implicitly. Maybe you can use a ViewCriteria object in order to create a criteria based on the attribute, and then find it by this criteria.
    As for your other question, findByKey acts upon all attributes of the view object that are marked as Key attribute. You can mark any attribute as key, whether or not it is a primary key constituent, by setting the Key Attribute Checkbox on the Attribute Definition, inside the View Object Wizard.
    Hope it helps,
    Thiago

  • Insert a row in master detail view & jboRowKey parameter

    Hi
    I hava a minor problem.
    On JSP page I have edit form for master view, beyond edit form is browse of detail view. I would like to insert or edit a row on master view and after update and commit, a would like to stay on the same page to insert some rows into detail view.
    When I editing rows it is Ok, becose jboRowKey parameter is always the same (to find proper row on master view).
    Problem appears when I want to Insert a row into master view, becose after transaction is commited, jboRowKey parameter is changed.
    Primary key on master table is sequence and it is inserted by (preinsert) trigger before commit.
    If anybody has some idea to solve this problem, please help.
    Gorazd

    Without knowing exactly the technology you are using, (JDev version, BC4J JSP tags/Components tags?),
    In general with BC4J after you do a commit, you do not necessarily have a record pointer on the new record that you just insert on the master table, so you would have to locate it again.
    Here is one way you could do this.
    After you commit your new inserted record, you could go back to a master "browse" page which shows the records of your master table along with a link to it's corresponding detail page. Encoded in the link you could pass the rowkey of the master record as a parameter and then in the detail page you could locate the master record that was clicked on by using the Find operation of the Row tag. When the master row is located, you automatically would be pointing to the correct detail records.
    In this case since the master was just created, there wouldn't be any detail records yet. You could then create new detail records for the new master..
    Let me know if this helps..
    -Chris

  • Inserting rows in master-detail views

    I have two VOs connected by a view link. I want to insert new rows in both the master VO and the detail VO and connect them together.
    I have the following:
    MasterEO (mapped to master_table)
    MasterVO (defined on MasterEO)
    DetailEO (mapped to detail_table)
    DetailVO (defined on DetailEO)
    MasterDetailAO (1 to many Association between MasterEO and DetailEO. master_id in detail_table references id in master_table)
    MasterDetailVL (1 to many ViewLink defined on MasterDetailAO)
    My AM looks like:
    MasterVO
    DetailVO via MasterDetailVL1
    I am trying to insert a new row in MasterVO, and a new row in DetailVO that should be linked to the new row in MasterVO. I used the code listed below. I was able to get the DetailEOImpl from the new row in DetailVO, and then get the new MasterEOImpl from the DetailEOImpl. However, when I called drow.getMasterVO() (drow being the new row created in DetailVO), I got null back instead of the new row in MasterVO. What do I have to do to connect the new row in MasterVO and DetailVO? (I got the same results regardless of whether the association is a composition or not)
    Also another thing I noticed, even though I've called setMaxFetchSize(0) on both VOs, the sql trace still shows the queries being executed. Is there anything else I need to do?
    MasterVOImpl master = (MasterVOImpl) testAM.findViewObject("MasterVO");
    DetailVOImpl detail = (DetailVOImpl) testAM.findViewObject("DetailVO");
    master.setMaxFetchSize(0);
    detail.setMaxFetchSize(0);
    MasterVORowImpl mrow = (MasterVORowImpl) master.createRow();
    mrow.setId(new oracle.jbo.domain.Number(10));
    master.insertRow(mrow);
    DetailVORowImpl drow = (DetailVORowImpl) detail.createRow();
    drow.setDetailId(new oracle.jbo.domain.Number(100));
    detail.insertRow(drow);
    DetailEOImpl deoi = drow.getDetailEO();
    MasterEOImpl meoi = deoi.getMasterEO();
    if (meoi != null)
    System.out.println("ID from EO: " + meoi.getId()); // This value is correct
    Row mrw = drow.getMasterVO(); // RETURNS NULL INSTEAD OF THE NEW ROW
    if (mrw != null)
    System.out.println("Row Class from Detail VO: " +
    mrw.getClass().getName());
    else
    System.out.println("Master VO is null");
    // THE OTHER DIRECTION ALSO DOESN'T WORK
    RowIterator rt = mrow.getDetailVO();
    DetailVORowImpl dd = (DetailVORowImpl) rt.first();
    // dd IS NULL
    if (dd != null)
    System.out.println("New Detail Row: " + dd.getDetailId());
    else
    System.out.println("New Detail Row from Master is null");

    You need to make your ViewObjects 'AssociationConsistent' for all collections to see new rows inserted into the cache. To set this setting for all VOs, edit your Appliation Module configuration and set the value for jbo.viewlink.consistent to be true.

  • 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

  • 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();

  • 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

  • ADFBC JTree Master-Detail view

    Hello, I am using Jdeveloper 10.1.3.3. with ADFBC.
    I have table ORGUNIT with following fields:
    1. ID_ORGUNIT
    2. NAME
    3. ID_PARENT_ORGUNIT
    I have created Entity and View for this table, and ViewLink which is used for fields ID_ORGUNIT and ID_PARENT_ORGUNIT.
    In short, I am trying to create JTree which contains data about organizational units.
    Let's say these are my data:
    1. "ADM" "ADMINISTRATION" "NULL"
    2. "FIN" "FINANCING DEPARTMENT" "NULL"
    3. "FIN1" "FINANCING DEPARTMENT - XXX" "NULL"
    4. "FIN2" "FINANCING DEPARTMENT - YYY" "NULL"
    5. "DEV" "DEVELOPMENT DEPARTMENT" "NULL"
    So, I want to use JTree to create hierarchy:
    ADM
    I--FIN
    I I--FIN1
    I I--FIN2
    I
    I--DEV
    The problem is, when I create view link previously described...I get all data from view with their descendants...
    ADM
    I--FIN
    I I--FIN1
    I I--FIN2
    I
    I--DEV
    FIN
    I--FIN1
    I--FIN2
    FIN1
    FIN2
    DEV
    Can anyone help me? What could be the problem?

    Hi John,
    Thank you for your assistance.
    Just to confirm the details of what I have.
    Master VO: CustomerVO (based on customer table) correct!>Child VO: A VO based on a join between preferences and customer_preferences. (i.e. base your VO on two EO's) correct!what I have is a customer VO based on a customer EO, a customer_preferencesVO based on a customer_preferencesEO and a preferencesVO based on a preferencesEO.
    View links exist between customerVO and customer_preferencesVO and again between preferences and customer_preferences thus facilitating a many-to-many relationship.
    so what I'm trying to do is construct a master detail view between customers and preferences . I figured that in order to achieve this I would need to create two new VO instances, one for customers and one for preferences and then to probable use a statement in the where clause so that only preferences are returned for customers on the current row where a relationship exist via the customer_preverencesVO.
    This is where I'm struggling in understanding how best to implement this.
    All I want is a mechanism whereby when I come to use a tree view component in my UI model I will have a node that will display preferences.
    Thanks again,
    Gary

  • ADF Faces and multiframe window for master/detail view

    Hi,
    I have a web page divide into 2 frames : frame1, the master view and frame2 the detail view.
    When I load the whole web page, the master frame print all the paginated list. Each row has a "show more" button. When I click one, the corresponding detail view is displayed in the detail view (frame2). And, when I clicked again the "show more" button, the paginated list (present in the master view) is displayed in the detail view !!! WHY ??
    When I click a third time on the "show more" button, the detail view display the corresponding detail information (work well like first click)....and alternatively clicking on the "show more" button, this problems occurs.
    Where does this problem come from ?
    The ADF Faces code shown in the master view (targetFrame attribute means to display on the detail view when show more button is clicked).
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!-- table displaying the list of buildings -->
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
         xmlns:af="http://xmlns.oracle.com/adf/faces">
         <jsp:directive.page contentType="text/html;charset=utf-8" />
         <f:view >
              <af:document title="List of buildings" >
                   <af:form >
                        <af:panelPage title="Show the list of buildings">
                             <af:table var="building" value="#{buildingsBean.buildingsList}">
                                  <af:column>
                                       <af:outputText value="#{building.name}" />
                                  </af:column>
                                  <af:column>
                                       <af:outputText value="#{building.objectId}" />
                                  </af:column>
                                  <af:column>
                                       <af:commandButton text="Show more"
                                            action="#{adfMasterSlaveBackingBean.showBuilding}" >
                                       </af:commandButton>
                                  </af:column>
                             </af:table>
                        </af:panelPage>
                   </af:form>
              </af:document>
         </f:view>
    </jsp:root>

    Yes I put a targetFrame (I forgot to restablish it).
    Code of the backing bean (to show building list) :
    public List getBuildingsList() throws Exception {
              System.out.println("getBuildings");          
              CLPNetworkInstanceAPI netAPI = CLPNetworkInstanceAPI.getNetworkInstanceAPI();
              buildingsList.clear();
    try {
         CTResource resources[] = netAPI.fetchAllResourcesByType("CLPRMBuilding");      
                   for (int i=0; i<resources.length;i++)
                        buildingsList.add(resources);
              } catch (CTConnectionException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (CTUnsupportedTypeException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return buildingsList;
    and the backing bean to show building detail :
    public String showBuilding() {
              FacesContext context = FacesContext.getCurrentInstance();
              CLPRMBuilding building = (CLPRMBuilding)
         context.getApplication().getVariableResolver().resolveVariable(context, "building");
         if (building == null)
         return "error";
         AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
         afContext.getProcessScope().put("buildingDetail", building);
         return "showBuilding";

  • Can there be multiple Master Detail Views, if yes then how? Please suggest

    Dear All,
    In first master-detail view, I have a button, which when clicked will trigger the second detail view.
    I tried invoking second master detail view but was not able to see the second master view. Could you please guide as to how to go about this.
    Thanks.

    Do a Google search. Here's one link.
    http://mobiforge.com/developing/story/developing-split-view-based-apps-ipad
     Cheers, Tom

Maybe you are looking for

  • SecurityException due to problems with realm

    Hi, we try to run our web application (developed and successfully deployed under WebLogic5.1) on the WebLogic6.0. After transforming the weblogic.properties file followed by adjusting the new config.xml and copying the necessary classes, *.jar, *.jsp

  • Getting the object id after persisting

    Is there an easy way of getting the object id after using the persist method? I tried the following code piece but it didn't work. Do I have to run a query? I'm new to JPA and waiting for your suggestions. Thanks.. Bill b = new Bill(); .... .... enti

  • Bank and Bank Branch Data Providers

    We are in the middle of a global R12 implementation, but are struggling with poor quality name and address data for banks and bank branches. Has anyone faced similar problems, and if so, did you consider using any external sources for reference infor

  • How to update a bound textField with user selection ?

    Hi all, I'm following an Update Database example from the JSC tutorials and have the following situation. I have a page displaying a row of data for a selected person (first_name, last_name, title) bound to a data provider. I have made the "title' fi

  • MOTION not allowing export of project after MAVERICKS upgrade.  What do I do?!

    After upgrading to MAVERICKS, MOTION 5 has no response when I choose to export my project.