Having multiple level of master/detail with data tags

Hi,
Here is a Database Model for the purpose :
- An EMPLOYEE is in one and only one DEPT
- a DEPT has several EMPLOYEEs
Suppose that:
- An EMPLOYEE come from one and only one SCHOOL which is in a SCHOOL table
- a SCHOOL have educated several EMPLOYEEs
Suppose that:
- A SCHOOL is part of one and only one SCHOOL_CATEGORY (Engineer school for example)
- A SCHOOL_CATEGORY concerns several SCHOOL
I would like to show a JSP page containing :
Employees for DEpt : 12456
table headers:
Employee ID | Employee Name | School Name | School Category Name
as you can see we have a master/detail between Master view DEPT and Detail view EMPLOYEE and EMPLOYEE is master for School which is detail view for employee and school category is detail view for school which is master for school category ! (do you follow me ? ;-))
Do you see my concerns ??
How do we do that whith data tags ??
Thank's a lot for you help...
It's urgent...

Hi,
I guess you are trying to achieve this using BC4J if so then you can modify your view object for employee so as to have School and category listed when you base your datatags on that view.
You would need to modify your view object query by using expert mode.
Thanks
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Olivier LAHILLE ([email protected]):
Hi,
Here is a Database Model for the purpose :
- An EMPLOYEE is in one and only one DEPT
- a DEPT has several EMPLOYEEs
Suppose that:
- An EMPLOYEE come from one and only one SCHOOL which is in a SCHOOL table
- a SCHOOL have educated several EMPLOYEEs
Suppose that:
- A SCHOOL is part of one and only one SCHOOL_CATEGORY (Engineer school for example)
- A SCHOOL_CATEGORY concerns several SCHOOL
I would like to show a JSP page containing :
Employees for DEpt : 12456
table headers:
Employee ID | Employee Name | School Name | School Category Name
as you can see we have a master/detail between Master view DEPT and Detail view EMPLOYEE and EMPLOYEE is master for School which is detail view for employee and school category is detail view for school which is master for school category ! (do you follow me ? ;-))
Do you see my concerns ??
How do we do that whith data tags ??
Thank's a lot for you help...
It's urgent...<HR></BLOCKQUOTE>
null

Similar Messages

  • Multiple level of Master Detail with ShowOneTab

    I am developing an ADF application using JDeveloper.
    Let us assume that we have three entities A,B and C. I have created three view objects and two View Link objects to implement three level Master-Detail relationship.
    I have created master table - detail table on a jspx page where master is entity A and detail is entity B. Detail table is in a showDetailItem component in showOneTab which works fine.
    Now I have the requirement to create another level of master detail hierarchy between entity B and C. The master of this relationship is B, which is displayed on one showDetailItem tab as stated above. While the detail for entity C must display on second tab (showDetailItem).
    I have set the partial trigger id of third table to masterDetail2 (id of the entity B table now serving as master). I have also set the AutoSubmit property of this table to true. But the data is not refreshed, it always displays the first set of records.
    Please suggest what I can do or if I am missing something to implement the solution?
    Regards,
    Amir

    Hi,
    I think this is because PPR doesn't work on hidden components (that are components that are not rendered). Try and add a listener to the tab canvas that then on changing the tabs, re-executes the iterator for this table
    Frank

  • Hi, i'm having trouble in filling a jtable with data

    hi, i'm having trouble in filling a jtable with data, but the real problem is that i have stablished a JDBC connection throught the windowsxp ODBC to my database written on microsoft access platform, so i created my table
    public CenterPanel(){
    panel = new JPanel();
    dataTable = new JTable(10,10);
    dataTable.setBorder(BorderFactory.createLineBorder(Color.black,2));
    panel.add(dataTable);
    setLayout(new BorderLayout());
    add(panel,BorderLayout.CENTER);
    i can see the table on my driver, but i want to fill it by connecting to the database and fil the fields from the database, i have the code to connect and retrieve the fields but on the dos, i want to fill them in the table,
    the code for accessing is
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection conn1 = DriverManager.getConnection      ("jdbc:odbc:EHLAN",
                             "marius","svasdiga");
                   Statement stmt1 = conn1.createStatement();
                   Statement stmt2 = conn1.createStatement();
                   ResultSet rs1 = stmt1.executeQuery ("select * from Appartment");
                   System.out.println("App. Num, Stair Num, Elec. Num");
              while (rs1.next()) {
                   System.out.print (rs1.getInt ("appnum") + ","+" ");
                   System.out.print (rs1.getString ("staircase") + ","+" ");
                   System.out.println (rs1.getInt("electrnum") );
    ResultSet rs2 = stmt2.executeQuery ("select * from Person");
    System.out.println("First Name, Last Name, Blood Type");
              while (rs2.next()) {
                   System.out.print (rs2.getString ("namef") + ","+" ");
                   System.out.print (rs2.getString ("namel") + ","+" ");
                   System.out.println (rs2.getString("bloodType") );
    so help me to fill this data to the table. thank you
    yours sincerely,
    marius ajemian

    hi, i'm having trouble in filling a jtable with data, but the real problem is that i have stablished a JDBC connection throught the windowsxp ODBC to my database written on microsoft access platform, so i created my table
    public CenterPanel(){
    panel = new JPanel();
    dataTable = new JTable(10,10);
    dataTable.setBorder(BorderFactory.createLineBorder(Color.black,2));
    panel.add(dataTable);
    setLayout(new BorderLayout());
    add(panel,BorderLayout.CENTER);
    i can see the table on my driver, but i want to fill it by connecting to the database and fil the fields from the database, i have the code to connect and retrieve the fields but on the dos, i want to fill them in the table,
    the code for accessing is
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection conn1 = DriverManager.getConnection      ("jdbc:odbc:EHLAN",
                             "marius","svasdiga");
                   Statement stmt1 = conn1.createStatement();
                   Statement stmt2 = conn1.createStatement();
                   ResultSet rs1 = stmt1.executeQuery ("select * from Appartment");
                   System.out.println("App. Num, Stair Num, Elec. Num");
              while (rs1.next()) {
                   System.out.print (rs1.getInt ("appnum") + ","+" ");
                   System.out.print (rs1.getString ("staircase") + ","+" ");
                   System.out.println (rs1.getInt("electrnum") );
    ResultSet rs2 = stmt2.executeQuery ("select * from Person");
    System.out.println("First Name, Last Name, Blood Type");
              while (rs2.next()) {
                   System.out.print (rs2.getString ("namef") + ","+" ");
                   System.out.print (rs2.getString ("namel") + ","+" ");
                   System.out.println (rs2.getString("bloodType") );
    so help me to fill this data to the table. thank you
    yours sincerely,
    marius ajemian

  • Please Help, Data Set Master/Detail with mySQL DB

    Hi...
    I installed the Data Set Master/Detail Sample (states and
    citys autopopulate) getting values from a XML file...
    when a user adds a listing in my site, it works great.. i use
    the XML file values for the states/citys and then everything is
    stored in a DB... BUT i need to do this..
    when he comes back to edit his listing, i want the Data Set
    Master/Detail to show hes values (from de DB) with the option to
    edit them, not the first XML file values.
    Thanks

    Thank you kinblas!!!!!
    I saw another post with the solution!!!
    Here it is
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadid =1308016&highlight_key=y&keyword1=SetDefaultState
    Thanks again!

  • Problem with apply changes on master-detail with respect to date handling

    dear sir,
    i have one tabler where in i have created from_Date and to_date as varchar2(30) each. I stored the from date as 'dd-mon-yyyy hh24:mi' I had written before header process for calculating no of days between from_Date and to_Date using the said format. If to_Date is null then first i store the value as
    to_char(sysdate,'dd-mon-yyyy hh24:mi') and then convert it as to_Date(substr(to_Date,1,17),'dd-mon-yyyy hh24:mi'). this calculation of days procedures works fine in sql command mode.
    when i am handling through master-detail page i works fine when there is null value inf to_Date vc2 column. if i store using date picker dd-mon-yyyy hh24:mi, the data is getting stored but subsequent edit through master detail give error as ora-01722 unable to fetch row. Manually if i set the to_Date as null pages works fine. I spent lots of time and unable to understand the mistake i do.
    if anybody could help me, i will be much obliged.
    thanking you,
    yours
    dr.s.raghunatha

    I think the best would be if you create an example on apex.oracle.com and I will debug it.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Parsing XML document with nested elements into multiple db tables(master-detail)

    Can you help me with storing xml document into master-detail tables?
    I have two tables:
    1) customers (customerid number primary key, firstname varchar2(30),lastname varchar2(30))
    2) cust_addresses (customerid number references customers, street varchar2(30),city varchar2(30),state varchar2(10),zip varchar2(10))
    I have XML document:
    <?xml version="1.0"?>
    <ROWSET>
    <ROW num="1">
    <CUSTOMERID>1044</CUSTOMERID>
    <FIRSTNAME>Paul</FIRSTNAME>
    <LASTNAME>Astoria</LASTNAME>
    <HOMEADDRESS>
    <STREET>123 Cherry Lane</STREET>
    <CITY>SF</CITY>
    <STATE>CA</STATE>
    <ZIP>94132</ZIP>
    </HOMEADDRESS>
    <HOMEADDRESS>
    <STREET>N.Fryda 4</STREET>
    <CITY>CB</CITY>
    <STATE>CZ</STATE>
    <ZIP>37005</ZIP>
    </HOMEADDRESS>
    </ROW>
    </ROWSET>
    I know that I must use DBSM_XMLSave package, create view and instead of trigger but I did found no example in documentation.
    Thanx.

    Interested question; one I do not know the answer to at the moment, I am afraid. I would like to know your results.
    To tell others, though, what I have done. I did finally adapt Muench's not-yet-published examples #71 to work with a table. Here the table has as it's value "#{backing_app_EPG_DAYPG.jobDayDriverTable[row.Id1]}"
    This accesses a hash map defined in the backing bean as follows:
    public Map jobDayDriverTable = new HashMap(){
    @Override
    public Object get(Object key) {
    Number jobDayId = (Number)key;
    if (getEpgDayPage().jobDayDrivers(jobDayId) != null) {
    return getEpgDayPage().jobDayDrivers(jobDayId).getAllRowsInRange();
    else return null;
    jobDayDrivers returns RowIterator. From this I call getAllRowsInRange which returns a Row[]. The table consumes this as a value, and lists the values as I want.
    Since the table is using Rows for its rows, I am guessing that it would have access to #{row.rowKeyStr}, or at least #{row.<pk>} which would allow you to programmatically set the current row using code like the following:
    public static boolean setCurrentRow() {
    // BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    // bindings.getOperationBinding("setCurrentRowWithKey");
    (OperationBinding)EL.get("#{bindings.setCurrentRowWithKey}");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return false;
    return true;
    You could call this as part of code in a pages backing bean behind a button or link.
    Hope this helps somebody.
    By the way example #71 was to get a detail set of rows from a master row value and display the detail set in the master row of an af:table.
    You can find this and other examples at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html

  • Master Detail with Search

    Hi All,
    I have created a Master (Form with Navigation buttons) - Detail (table) with search region.
    Intially both regions show no data as expected.
    When I search for an entry in Master region - It shows the data in Master but not in Details region.
    When I click Next in the Master then I can see details in the Table.
    Now if I click Prev in the Master I can see the details in the Table.
    If I tried to search for new data , Master form gets refreshed but details table will not get refreshed till I click on navigation buttons.
    (I think details is getting refreshed on Navigation button Events)
    If I don't have any search region.. Both Master and Details get initial load works fine.
    I tried creating Master(table)/ Detail(table) with search region on top of them.
    No data resulted.. :( after querying the data. (As there are no navigation none of the tables get refreshed).
    Pl. let me how to get the details get data based on Master.
    Thanks,
    Satya

    Shay,
    I did set the page Refresh between two areas.
    It works fine if I click on Navigation button Next, Prev.
    This happens only if I have Search bean on top to search master.
    Thanks,
    Satya

  • Master Details with ADFBC Listbox

    Hi Everyone,
    I'm trying to setup master - detail page with ADF BC, using Dept / Emp.
    I want to use a listbox for the master object, rather than the form + navigation commands as shown in the classic demos, so I've setup a listbox as following:
    <af:selectOneListbox value="#{bindings.DepartmentsView1.inputValue}"
    label="Available Flows:"
    id="listbox_depts">
    <f:selectItems value="#{bindings.DepartmentsView1.items}"
    id="id_Selcet_Items"/>
    The details element is the classic read-only table created by dragging the Employees view (under the departments) into the page.
    The problem arises when I run the page - the list box shows all the departments, but when I click on different departments the table data does NOT change (as it would when navigating between rows with the classical form navigation buttons).
    I've set up the Table's partial triggers to both of the listbox ids: id_Selcet_Items and listbox_depts but this doesn't help.
    Is this a bug, or am I doing something totally wrong?
    Tal.

    This looks like a good question for the JDev 11g TP3 forum.
    -h.

  • How to move elements within the master region of a Master/Detail spry data set?

    Hi there,
    I am unsure of how to move the different items within the master region of a master/detail spry dataset. The default style is such that if I include 3 or more elements e.g. Thumb, etc., they are stacked vertically :
    How do I move them so that they can be positioned differently? The look I am going for is one where the thumb image is positioned to the left while the other items are stacked alongside it so that the end effect for the master region would look like this:
    I greatly appreciate the help! Thanks!

    This is the complete page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Check :: Fashion+Lifestyle</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMasterDetail_final.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var cal4 = new Spry.Data.HTMLDataSet("calendarList.html", "calendarList", {sortOnLoad: "When", sortOrderOnLoad: "ascending"});
    cal4.setColumnType("Thumb", "html");
    cal4.setColumnType("Picture", "html");
    cal4.setColumnType("When", "date");
    function MM_effectAppearFade(targetElement, duration, from, to, toggle)
        Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function closeAd() {
        document.getElementById('adRollover').style.visibility='hidden';   
    function MM_effectBlind(targetElement, duration, from, to, toggle)
        Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectSlide(targetElement, duration, from, to, toggle)
        Spry.Effect.DoSlide(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
        Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
    //-->
    </script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="pageContainer">
        <div id="adBanners">
            <div id="halfBanner"><a href="#" onClick="document.getElementById('adRollover').style.visibility='visible';"><img src="images/banner_half_1.jpg" alt="Half Banner" width="237" height="90" /></a></div>
            <div id="leaderboardBanner"><a href="#"><img src="images/banner_leaderboard_1.jpg" width="728" height="90" alt="Leaderboard Banner" /></a></div>
            <div class="clearFloats"></div>
        </div><!--div#adBanners-->
        <div id="mainHeader">
            <div id="homepageLink"><a href="index.html"><img src="images/spacer.gif" width="400" height="100" /></a></div>
            <ul id="MenuBar1" class="MenuBarHorizontal">
                <li><a href="feature.html">FEATURES</a></li>
                <li><a href="#">FASHION</a></li>
                <li><a href="calendar.html" class="on">CALENDAR</a></li>
                <li><a href="#">VIDEO</a></li>
                <li><a href="blog.html">BLOG</a></li>
            </ul>
        </div><!--div#mainHeader-->
        <div class="MasterDetail">
          <div class="DetailContainer" id="event" spry:detailregion="cal4">
            <div class="DetailPicture">{Picture}</div>
            <div class="DetailColumn DetailTitle">{What}</div>
            <div class="DetailColumn"><div class="DetailLabel">WHEN:</div> {When}
            </div>
            <div class="DetailColumn"><div class="DetailLabel">WHERE:</div> {Where}
            </div>
            <div class="DetailColumn">{Details}</div>
          </div>
          <div id="calHeader"><p><img src="images/calendar_hdr.gif" width="492" height="100" /></p></div>
          <div spry:region="cal4" class="MasterContainer" onclick="MM_effectAppearFade(this, 1000, 0, 100, false); MM_effectBlind('event', 1000, '0%', '100%', false);">
            <div class="MasterColumn" spry:repeat="cal4" spry:setrow="cal4" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected"><div class="MasterColumnPicture">{Thumb}</div>
              <div class="MasterColumnTitle">{What}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHEN:</div> {When}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHERE:</div> {Where}</div>
              <div style="clear:both"></div>
            </div>
          </div>
          <br style="clear:both" />
        </div>
    </div><!--div#pageContainer-->
    <div id="footer">
        <div class="text">Use of this site constitutes acceptance of our User Agreement and Privacy Policy. &copy; 2008 Adobe All rights reserved. The material on this site may not be reproduced, distributed, transmitted, cached, or otherwise used, except with the prior written permission of Adobe is a trademark owned by Adobe.</div>
    </div><!--div#footer-->
    <div id="adRollover" style="visibility: hidden;">
    <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                'width', '536',
                'height', '479',
                'src', 'watch_ad',
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'transparent',
                'devicefont', 'false',
                'id', 'watch_ad',
                'bgcolor', '#ffffff',
                'name', 'watch_ad',
                'menu', 'true',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'watch_ad',
                'salign', ''
                ); //end AC code
    </script>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="536" height="479" id="watch_ad" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="watch_ad.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
        <param name="wmode" value="transparent" /><embed src="watch_ad.swf" quality="high" bgcolor="#ffffff" width="536" height="479" name="watch_ad" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>

  • Master-detail with dynamic view object

    How can you create a view link with a view object that is dynamic? I have created a master-detail relationship on a UIX page. I change the master view object at runtime using a view definition and SQL and then I bind the view object to an iterator on a UIX page. I need the new dynamic view object to maintain the link between the detail view object. Is this possible?
    The reason why I have to change the view object at runtime is because I am implementing a search module and the tables in the from clause can be modified at runtime so I need to have a dynamic view object.
    Thanks,
    Sanjay

    After playing around with ViewObjectImpl's setQuery() method some more I found out that this solution might not work for me due to the following reason: when the user tries to sort a column in the result table, the original contents of the view object get executed instead of the run time query.
    <p>
    I would like to go back to my original solution that included creating a view definition based on the runtime query and then creating a view object from that which I bind to the RowSetIterator. The missing piece to the master-detail functionality is with the detail Iterator being in sync with the master. I have tried the following but I get a ClassCastException <p>
    DCIteratorBinding detailBinding = ctx.getBindingContainer().findIteratorBinding("DetailIterator");
    detailBinding.getViewObject().<b>setMasterRowSetIterator</b>(masterBinding.getRowSetIterator());
    <p>
    here is the relevant stack trace:
    java.lang.ClassCastException
    at oracle.jbo.client.remote.ViewUsageImpl.getImplObject(ViewUsageImpl.java:1829)
    at oracle.jbo.client.remote.RowSetImpl.setMasterRowSetIterator(RowSetImpl.java:512)
    at oracle.jbo.client.remote.ViewUsageImpl.setMasterRowSetIterator(ViewUsageImpl.java:1147)
    at oracle.jbo.common.ws.WSViewObjectImpl.setMasterRowSetIterator(WSViewObjectImpl.java:1005)

  • Master/details with render false on details when no rows doesn't work fine

    I created a standard master/details (form/form) based on Dept and Emp tables.
    This work as expected.
    Then i changed the rendered property of the details table by setting the following EL #{bindings.DeptView1EmpView2.estimatedRowCount>0}
    because i do not want details table to appear when there are no rows
    Here is how things go
    1) navigate to deptno 10, you see the employees of dept 10 correctly, the same applies to 20, and 30, but when you select dept 40, things start acting kind of wierd
    the details table does not disappear as expected
    returning back to dept 10, or 20 etc does not also render the details it freezes, keep navigating between 10,20,30 and randomly, the screen refershes correctly, until you again hit an master with empty details.
    If you select a master with empty details and use the submit buttom, the details table disappears as it should, if you try other master rows, the details remain hidden until you submit the page manually
    any ideas
    regards
    Ammar Sajdi

    hello again
    i removed PPT and the autosubmit that are created by default, and replaced them with JavaScript Submit() operation linked to the master table row selector. Now it works, but really i still do not know the negative implications of this work around. I feel it is not a good idea, since ADF designer favoured using the PPR method
    Ammar

  • PRISM Master-Details with navigation between the Master and details view

    Hi, I have a Master list with accounts and a Details list containing transactions.
    The Master list : has a UserControl (AccountListView) and Viewmodel(AccountListViewModel)
    The list is bound to an observable collection of type AccountViewModel and has a SelectedAccount property to get the current selected account. Each AccountViewModel has a collection of type TransactionViewModel.
     public AccountListView(IAccountListViewModel viewModel)
                //this.DataContext = vm;
                InitializeComponent();
                ViewModel = viewModel;
            public Infrastructure.IViewModel ViewModel
                get
                    return (IAccountListViewModel)DataContext;
                set
                    DataContext = value;
    //the viewmodel
            public AccountListViewModel(IRegionManager regionManager)
                this.regionManager = regionManager;
                this.AccountList = GetAccounts(); // gets the list of accounts from another layer
            public AccountViewModel SelectedAccount
                get { return selectedAccount; }
                set
                    selectedAccount = value;
                    OnPropertyChanged("SelectedAccount");
    And the Details view has a user control(TransactionListView) and a viewmodel(AccountView);
    public TransactionListView(IAccountViewModel viewModel)
                InitializeComponent();
                ViewModel = viewModel;
                //this.DataContext = vm.SelectedAccount;
            public Infrastructure.IViewModel ViewModel
                get
                   return (IAccountViewModel)DataContext;
                set
                    DataContext = value;
    //the viewmodel 
    public AccountViewModel(Business.Account a)
                    AccountId = a.AccountId;
                    accountName = a.AccountName;
    I created a hyperlink command so that whenever I click on the name of an account from the master list it will navigate to the detail list and set the as the DataContext the account I clicked on. Before I had both Master and Detail lists displayed at the
    same time and set the DataContext of the Detail List as the SelectedAccount property(which is bound to the SelectedItem of the Master List) of the Master List. I am not sure how to pass the SelectedAccount when I navigate to the Detail List and set it as the
    DataContext of the Detail List.
           

    >>I'm using the reguestnavigate method, but from what I read you can't pass objects as parameters ?
    As I mentioned there is a NavigationParameters class that you can create an instance of and pass as a parameter to the RequestNavigate method in Prism 5:
    private void NavigateTransaction(AccountViewModel obj)
    var parameters = new NavigationParameters();
    parameters.Add("accountViewModel", obj);
    regionManager.RequestNavigate(RegionNames.ContentRegion, new Uri(transactionview, UriKind.Relative), parameters);
    The TransactionView should then implement the Microsoft.Practices.Prism.Regions.INavigationAware interface and retrieve the parameter in the OnNavigatedTo method:
    public partial class TransactionView : UserControl, INavigationAware
    public TransactionView()
    InitializeComponent();
    void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
    AccountViewModel myParameter = navigationContext.Parameters["accountViewModel"] as AccountViewModel;
    this.DataContext = myParameter;
    public bool IsNavigationTarget(NavigationContext navigationContext)
    return true;
    public void OnNavigatedFrom(NavigationContext navigationContext)
    In Prism 4 there is no NavigationParameters class so you either need to upgrade to Prism 5 if you haven't already done so or you could store the parameters to be passed yourself somewhere else. Please refer to the following links for more information and
    examples of how you could do this:
    http://stackoverflow.com/questions/9320638/how-to-pass-an-object-when-navigating-to-a-new-view-in-prism
    http://visualstudiomagazine.com/articles/2012/08/20/view-communication-in-wpf-and-prism.aspx
    Please also remember to mark helpful posts as answer to close the thread and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • Master-detail with auto-generated primary key(master)

    Hello,
    I have the following master-detail setup:
    Master - block A primary key is: codeA
    Detail - block B
    codeA is genrated only at commit time and is obtained from a sequence.
    User needs to add detail records. This is easy to do since he has to click on the insert icon on the toolbar. At commit time, use commit_form.
    Prob: the requirements as asked by the client is to add a button (which we will label INSERT DETAIL). When the user click on the button, it opens a window where he can enter the detail info then click on save. This should bring him back to the master-detail form and the record in the detail block is inserted.
    What is the problem here ? since the detail block has the foreign key tied to the master primary key, the window-form (with the call_form) that we opened for the detail entry won't be able to save since at this point we still have not assigned a value for the primary key (and hence a value for the foreign key).
    Possible Suggestions:
    -Use a temp database table to hold the detail record from the second form and use it to transfer values to the detail record in the master-detail
    -Use a global record group
    -We can't use parameter list to pass back these values.
    So my question is:
    What would be the most efficient way to have an insert button on the detail block that would allow the user to have a pop up where he can insert his values and then be brought back to the master-detail.
    Thanks.

    Hello again,
    May be I was not clear enough.
    Scenario 1: We use the master-detail form as is with the default oolbar. In this case, the user can insert the detail records one by one without needing the primary-foreign key value since this is handled by default.
    Once we save the form (commit_form), I use the pre-insert trigger to get the master block primary key generated from the sequence and since the detail block key is copied from this value, both are saved correctly and it is the end of the story.
    Scenario 2: As explained in the initial post, the user will populate the detail records one by one by clicking on the -INSERT DETAIL- button and hence has a window where he can insert the detail info and then be brought back to the master-detail form every time he enters a new detail record.
    The problem here is that I can't generate the primary key for the master block since the client has the following requirement:
    The user can always change his mind and not complete, meaning save the form, his process
    As such, the key should be generated in the last step before Commit.

  • Master Detail with programmatic ViewObjects and writeXML

    Hi,
    Using jdev 11.1.1.3.
    I created two programmatic ViewObjects related by a ViewLink (1to*).
    From an application module method, I create a row in the master ViewObject. Then using the accessor obtain the RowIterator for the detail, and create a row on that detail.
    If then I use the writeXML method on the master ViewObject, the output is only representing the master, not the detail.
    Here is the code:
            VO_MasterImpl voMaster = getVO_Master2();
            //create the master row
            VO_MasterRowImpl rowMaster = (VO_MasterRowImpl)voMaster.createRow();
            String id = "unique";
            rowMaster.setAtt1(id);
            rowMaster.setAtt2("something");
            //obtain the rowIterator for the detail
            RowIterator detail = rowMaster.getVO_Detail();
            //create the detail row
            VO_DetailRowImpl rowDetail = (VO_DetailRowImpl)detail.createRow();
            rowDetail.setAtt1(id);
            rowDetail.setAtt2("sth2");
            //insert the detail row
            detail.insertRow(rowDetail);
            //insert the master row
            voMaster.insertRow(rowMaster);
            //obtain the xml
            Node node = voMaster.writeXML(-1,XMLInterface.XML_OPT_ALL_ROWS);master.att1 is key for Master.
    detail.att1 is foreign key to Master.
    This is the contents of node:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <VO_Master><VO_MasterRow><Att1>unique</Att1><Att2>something</Att2></VO_MasterRow></VO_Master>What I would expect is that the detail row (<VO_DetailRow>) appears within the <VO_MasterRow>.
    Anyone knows what I'm missing here?
    Thanks
    Roger B
    Edited by: RogerB on 30-Dec-2010 02:16

    Hi,
    After some more tests...
    As said before, I tried with SQL VOs (Dept and Employees). No differences between the VL Dept and Emp, and the VL VO_Master and VO_Detail. They have same relationship (1 to *) and also same (changing names) SQL where (source and destination).
    I debuged the code, using ADF source code, and noticed the following:
    When iterating the rows to write the XML, at ViewRowImpl, it takes the AttributeDef and perform different actions depending on mKind (ATTR_ASSOCIATED_ROW or ATTR_ASSOCIATED_ROWITERATOR). Second one is for ViewLink.
    Once inside ATTR_ASSOCIATED_ROWITERATOR, I can see that the default RowSetIterator, has no rows (getRowCount = 0). So no child rows (for the VO_Detail), are added to the XML Node.
    On the other hand, the Dept and Employees, I can see that the default RowSetIterator has rows.
    Could this be related to the fact that Programatic ViewObjects are not persisted anywhere?
    any other clues appreciated? Does anyone tried this before (programatic master detail relationship writing to XML) ?
    Regards,
    Roger

  • Master detail with from clause query

    Hi!
    I have 2 blocks: master and detail. The master block is based on a from clause query. Since I have to insert, update and delete on this block I have created the on-insert, on-update, on-delete and on-lock triggers (and the respective procedures).
    In this block I have on-populate-details and pre-delete triggers created by the master-detail relation.
    Now I have a problem!
    Since I only want to commit to db when I click the "ok" button and I want to insert and delete records from these 2 blocks, when I insert records into the detail block (and master too), it forces me to save changes if I change the focus of the current record of de master block to another record within the same block.
    How can I do this in order to insert records saving changes only when I click the button?
    Thanks!
    Ana

    I think that it is intended behaviour: when detail records are populated and there are uncommited changes so Forms asks if user wants to save changes.

Maybe you are looking for