Retrieve all records in the selected master child multi tables

Hello
I use JDeveloper 11.1.1.4 version and using ADF - BC in my project.
I have a one-to-one simple child master [several] in my project.
In my view page, I display this master child [Ex: EmpVo1-> DeptVo2] in the form of tables.

I have multi-selection enabled for the main table.
My requirement is that, on the multi by selecting the lines in the main tables, I want to get all the child records in my grain of support.
If a master has 3 child records line and another main line has 4 child records and on the selection of several of these two records in the primary table, I should get all the child records in my grain of support.
I need it to implement the cascade delete feature.
Here is the sample code coin
--------------------------------------------

(1) called on selecting rows in the master table

{} public void onRSCGrpSelect (SelectionEvent selectionEvent)
Add the code in the event here...
ADFUtil.invokeEL ("#{bindings.") RscGroupVO1.collectionModel.makeCurrent} «»
new class [] {SelectionEvent.class},
(New Object() {selectionEvent});

RowKeySet rowKeySet = (RowKeySet) tblRSCGrp.getSelectedRowKeys ();
CollectionModel cm = (CollectionModel) tblRSCGrp.getValue ();

for (object facesTreeRowKey: rowKeySet) {}
cm.setRowKey (facesTreeRowKey);
RowData = JUCtrlHierNodeBinding
(JUCtrlHierNodeBinding) cm.getRowData ();
Line = rowData.getRow ();
System.out.println ("\n" +)
row.getAttribute (0) + ":" + row.getAttribute (1) +.
(":" + row.getAttribute (2));

System.out.println ("display the child records");
displayChildRecords (row.getAttribute (0));

}

}

2 private void displayChildRecords (Object rscGrp) {}
ViewObject rscMapVo = getRscMapViewObj();
RowSetIterator rsI = rscMapVo.createRowSetIterator (null);
While (rsI.hasNext ()) {}
Line = rsI.next ();
System.out.println ("\n" +)
row.getAttribute (0) + ":" + row.getAttribute (1) +.
(":" + row.getAttribute (2));
}
rsI.closeRowSetIterator ();
}

But the problem is that he is always giving me the last selected lines child details.

Please suggest the error that I do.

Thank you
Praveen

Your problem is to use makecurrent, which should not be used on a multi selection table. Then, if you have a relationship master detail you should have a view link between them. In this case, you can expose a method as you master to get the related child line. Not need to get the VO itself you can use the accessors of child iterator to obtain registration of the child.

public void onRSCGrpSelect(SelectionEvent selectionEvent) {
// Add event code here...
RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();

for (Object facesTreeRowKey : rowKeySet) {
cm.setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding)cm.getRowData();
Row row = rowData.getRow();
//cast to the right row class
EmpEmpVoRow empRow = (EmpEmpVoRow) row;
// now you cann access the child row iterator
RowSetIterator it = empRow.getDepVO();
//now you cna iterate over the child rows
System.out.println("\n" +
row.getAttribute(0) + " :: " + row.getAttribute(1) +
" :: " + row.getAttribute(2));

System.out.println("Displaying Child Records");
//use hte child rows here

}

}

Don't know if the code compiles out of the box (do this on the train :-)

Timo

Tags: Java

Similar Questions

  • Updated all the selected lines in a table.

    Hello

    Jdev Version 11.1.2.3.0

    I'm trying to update all the selected rows in a table with several choices.

            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ViewObject vo = am.findViewObject("RegistrationHistory1");
            RowKeySet selectedRegistrations = historyTable.getSelectedRowKeys();
    
    
            if (selectedRegistrations != null) {
                Iterator iter = selectedRegistrations.iterator();
                    while (iter.hasNext()) {
                        Object facesTreeRowKey = iter.next();
                        Row[] row = vo.findByKey((Key)((List)(facesTreeRowKey)).get(0), 1);
    
    
                        if (row != null && row.length == 1) {
                            Row r = row[0];
                             r.setAttribute("Attr", "1"); 
                        }
                    }
              }
    

    But after I put the attribute on the line. My iterator ignores most of the lines and they don't last updated.

    It works very well for the removal of the line well.

    Any suggestions?

    It turn out that I got a try catch and in the catch, I had a log (e.printStackTrace ()) and I do not see a single line in the diary saying ConcurrentModificationException appearing all the time.

    Looks for read-only access to an attribute or delete lines is OK to iterate over the selected lines, but it's different for the modification of an attribute.

    The code that worked:

    Links DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    Entry DCIteratorBinding = bindings.findIteratorBinding ("RegistrationHistory1Iterator");

    RowSetIterator regRSiter = regIter.getRowSetIterator ();

    RowKeySet selectedRegistrations = historyTable.getSelectedRowKeys ();

    Object [] keys = selectedRegistrations.toArray ();

    for (Object key: keys) {}

    Line currentRow = regRSiter.getRow ((Key) ((List) key) .get (0));

    removeOrModify (currentRow);

    }

  • Open all files in the selected folder .indd

    Hi all

    I want to open all files in the selected folder .indd.

    Try the script:

    myFolder var is Folder.selectDialog ("select a folder with the InDesign files");.

    var myFiles = [];

    var myFileList = myFolder.getFiles ();

    for (var i = 0; i < myFileList.length; i ++) {}

    var myFile = myFileList [i];

    myFile.name.match(/\.indd$/)

    myFiles.push (myFile);

    App.Open (myfiles)

    }

    Can someone give a solution to me.

    Thanks in advance

    BEGINNER

    myFolder var is Folder.selectDialog ("select a folder with the InDesign files");.

    If (! MyAccount)

    Exit (0);

    var myFileList = myFolder.getFiles ();

    for (var i = 0; i)< myfilelist.length;="" i++)="">

    var myFile = myFileList [i];

    (Si (myFile instanceof fichier && {myFile.name.match(/\.indd$/i))}

    App.Open (MyFile);

    }

    }

    See you soon,.

    Stephen

  • Insert all records from a custom to a staging table.

    Hello

    Is it possible to insert all records of a cursor in a custom table using plsql instead of open a cursor, and each record in a loop?

    Thank you

    KK

    Use INSERT INTO your_staging_tbl... SELECT... Of your_cuatom_tbl

  • Failed to retrieve all records in a series

    original title: I have an audio book where each disc but the disc four torn, why used this disk rip

    I get a pop up that says windows cannot retrieve this record

    I get a pop up that says windows cannot retrieve this record

    ======================================
    If you have more than one optical drive...
    Try this one.

    It is possible that the disc is damaged or it may need
    cleaning. I use warm water and a little mild soap.

    Then rinse well and dry with a soft cloth (I use a t-shirt)
    wiping from the Center to the edge, not in circles.

    Good luck...

  • quest 2: can I uninstal just 1 out of all applications in the suite master Cs5? And if so, how the just indesign software.

    I have the cs5 master collection. I just need to re download the ID due to technical errors. to try to anchor. The content spilled and I put files in the folder plug and idk if this was still just to do (I bet not) Idk how repair it is just so maybe 1 program uninstal and re install. But IDK how its share of main or is more f - not important?

    How can I uninstall InDesign without uninstalling Illustrator etc.

    Or would it be easier to correct what I did? Take the app Finder and forced to get back but not correctly with the contents of the folder (presets, plug ins, etc.) records were not inside the app.

    Need help please, I tried to call the 1800 and no luck:)

    5Royalty5 high5 became the following error clicking Install.app: ' install.app cannot be opened should take out the drive.

    For others having the similar problem, launch the install.app content in the Terminal.

    Exact measurements:

    (1) right click on install.app.

    2) click on "Show Package Content".

    3) navigate to contents > MACOS > install

    (4) drag and drop installation surfed in step 3 in the Terminal (go > utilities > Terminal) and press ENTER.

    Installation should start. Follow the instructions on the screen to complete the installation.

    Concerning

    Nathalie

  • All records in the report need when I downloaded to Excel

    Hello
    for all my reports (Adhoc, canned), I need to display 25 records in the page, and if I download the results to excel I want that all the records in excellent.

    I use the below configurations in my file.it instanceconfig works very well for the number of records for each page. But if I download the report, it's download only 25 records that are playing on this perticular page.

    Someone tell how can I download all records in excellent with 25 records per page?

    < Center >
    < > 10020000 MaxCells < / MaxCells >
    < MaxVisibleColumns > 30 < / MaxVisibleColumns >
    < MaxVisiblePages > 1000 < / MaxVisiblePages >
    < MaxVisibleRows > 64000 < / MaxVisibleRows >
    < MaxVisibleSections > 25 < / MaxVisibleSections >
    < DefaultRowsDisplayed > 25 < / DefaultRowsDisplayed >
    < DefaultRowsDisplayedInDelivery > 75 < / DefaultRowsDisplayedInDelivery >
    < defaultRowsDisplayedInDownload > 64000 < / DefaultRowsDisplayedInDownload >
    < DisableAutoPreview > false < / DisableAutoPreview >
    < / Center >
    < table >
    < > 10020000 MaxCells < / MaxCells >
    < MaxVisiblePages > 1000 < / MaxVisiblePages >
    < MaxVisibleRows > 64000 < / MaxVisibleRows >
    < MaxVisibleSections > 25 < / MaxVisibleSections >
    < DefaultRowsDisplayed > 25 < / DefaultRowsDisplayed >
    < DefaultRowsDisplayedInDelivery > 75 < / DefaultRowsDisplayedInDelivery >
    < defaultRowsDisplayedInDownload > 64000 < / DefaultRowsDisplayedInDownload >
    < /table >

    Published by: user12077461 on August 9, 2011 18:14

    He shud behave similarly... I mean all the files shud be downloaded. You can try this in any other envn? UAT or DEV?

    I'm 100% sure that it shud download all...

  • Show all records in the search results, please help

    I have this before posting, but had no chance I used my script to search before but tried again and he's back ALL results of the DB... Can you see what I'm missing?

    $var_SalaryReq_Recordset1 = '% ';

    If (isset($_GET['SalaryReq'])) {}

    $var_SalaryReq_Recordset1 = $_GET ['SalaryReq'];

    }

    $var_skills_offered_Recordset1 = '% ';

    If (isset($_GET['skills_offered'])) {}

    $var_skills_offered_Recordset1 = $_GET ['skills_offered'];

    }

    $var_location_Recordset1 = '% ';

    If (isset($_GET['location'])) {}

    $var_location_Recordset1 = $_GET ['location'];

    }

    $var_PositionReq_Recordset1 = '% ';

    If (isset($_GET['PositionReg'])) {}

    $var_PositionReq_Recordset1 = $_GET ['PositionReg'];

    }

    @mysql_select_db ($database_hostprop, $hostprop);

    $query_Recordset1 = sprintf ("SELECT username, name, surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s or PositionReq AS location, AS GOLD skills_offered GOLD AS %s %s %s", GetSQLValueString ("%". ") $var_SalaryReq_Recordset1. '%', 'text'), GetSQLValueString ('%'. $var_PositionReq_Recordset1.) '%', 'text'), GetSQLValueString ('%'. $var_location_Recordset1.) ('%', 'text'), GetSQLValueString ('%'. $var_skills_offered_Recordset1, "text"));

    $query_limit_Recordset1 = sprintf ("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);

    $Recordset1 = mysql_query ($query_limit_Recordset1, $hostprop) or die (mysql_error ());

    $row_Recordset1 = mysql_fetch_assoc ($Recordset1);

    the search fields are

    < input name = "PositionReq" type = "text" class = "textfeilds" value = "Job title" size = "32" / >

    < input name = "skills_offered" type = "text" class = "textfeilds" value = "Required skills" size = "32" / >

    < input name = "SalaryReq" type = "text" class = "textfeilds" value = "Salary offered" size = "32" / >

    < input name = "location" type = "text" class = "textfeilds" value = "Location" size = "32" / >

    Thanks in advance

    Sorry, just need a push of foot. "%"

    Thanks for the prompt.

    concerning

  • ADF Table retrieves all lines during the loading of the page

    Hello

    We have a requirement where we need run the query programmatically by giving the query column and its value.

    I used the code below in the AMimpl.java and calling this method during the click on the button Search my Search Page.

    I am able to get the features you want on the search page by clicking the search button.

    The question now is when the page initially loads, the table fetches all rows of the VO by default.

    Can you please let me know where I need to change so that the table will get no line on the initial load of the page?

    ' public void setVoParams (String columnName, String columnValue) {}

    ViewObject mapVO = this.getFusionSapMapping1 ();

    String whereClause = "MappingEO." + columnName + "" as: colValue ";"

    mapVO.setWhereClause (whereClause);

    mapVO.defineNamedWhereClauseParam ("colValue", null, null);

    mapVO.setNamedWhereClauseParam ("colValue", columnValue);

    mapVO.executeQuery ();

    }

    Hello

    You don't tell us your version of JDeveloper.

    An easier approach to implement your condition is to use the property refreshCondition of your iterator. Here is an example of how do: https://blogs.oracle.com/shay/entry/delay_method_execution_when_us

    Antonis

  • [JDev12c, ADF] How to get the value of a field from the selected line in af:table and...

    Hallo,

    I want to double click on a line of an af:table to call a page that displays a form (based on a View object) with the details of the selected line.

    I need to go to the second page the value of a field on the line that is selected on the first page.

    How can I do this? In particular, how can I get the value of a field from the selected line? How can I call the second page on double-click on the af line: table?

    Thank you

    F.

    Why would user, you need to pass a value of the line to the shape?

    The framework selects the line you want to display in the form. All you have to do is to show the form with the selected line. It is the framework automatically as long as you use e vo even the same data control.

    Timo

    Post edited by: Timo Hahn
    And the handling double-clicks is described here http://www.oracle.com/technetwork/developer-tools/adf/learnmore/56-handle-doubleclick-in-table-170924.pdf

  • Toggle the button toolbar on the selection of rows in table

    Hi all
    I have a problem with activation and deactivation of the toolbar button when the table row is selected... Here's the deal:

    I have a toolbar button named "activate" I want to activate only when the selected table line has say for example 'description' field is not empty. I'm looking for a solution so that I can say declaratively:

    < disabled af:commandToolbarButton = "#{I'M looking FOR THIS CASE =="} "/ >"

    I tried using #{bindings.activateAttributeFromSameIterator} thinking that when the selection on the row in the table is changed, the change is reflected also and I will get the result, but without success (that link was nothing)... I also updated partialTriggers this toolbar button.


    I would appreciate if anyone can shed some light on this...

    Thank you

    Hello

    create a binding of the attributeValue to the descriptor field using the "Bindings" tab in the Visual Editor. In the connections section, click the Green plus icon, choose generic and attributeValue Bindings are included. Select the iterator used by the table and select the attribute "descriptor" (the name of the attribute that you mentioned). Then change

    TO

    Frank

  • Popup event on the selection of rows in table tree

    I use jdev 11.1.1.7

    I followed below page to pass parameters between the regions. It works fine if I use a button to trigger the event & pass the id of selected in a table of the tree line.

    Tech Blog of Rohan Walia: events background - Basic step by step: ADF

    I wanted to avoid button, I'm trying to pass data directly on the selection of rows in the tree.

    < eventBinding id = "eventBinding".

    Listener = "org. Apache.MyFaces.Trinidad.Event.SelectionListener">

    " < events xmlns =" http://xmlns.Oracle.com/ADFM/contextualEvent "> "

    < name of event = 'FireEvent '.

    customPayLoad="#{pageFlowScope.ManageOrgsBean.selectedID}"/ >

    < / events >

    < / eventBinding >

    < / links >

    " < events xmlns =" http://xmlns.Oracle.com/ADFM/contextualEvent "> "

    < name of event = 'FireEvent '.

    customPayLoad="#{pageFlowScope.ManageOrgsBean.selectedID}"/ >

    < / events >

    I get a NPE in the 3rd line below:

    {} public void onTreeNodeSelect (SelectionEvent selectionEvent)

    BindingContainer DCBindingContainer = ADFUtils.getDCBindingContainer ();

    JUEventBinding eventBinding = (JUEventBinding) bindingContainer.get ("FireEvent");

    SelectionListener selectionListener (SelectionListener) = eventBinding.getListener (); NPE

    selectionListener.processSelection (selectionEvent);

    }

    Any idea? Thank you.

    Try with:

    JUEventBinding eventBinding = (JUEventBinding) bindingContainer.get ('eventBinding');

  • Turn off the ADF parasmo tab based on the selection of rows in table

    Hello

    We have page ADF, which consists of a table within a collection of panels, which in turn is inside a Panel tab that user can select several rows in this table. There is also a second tab that you want to activate only if the user has selected a single line in the table. This should be disabled if several lines are selected in the table. Please let me know how this can be accomplished. The selection of multiple rows in the table is a must for users.

    I use jDeveloper 11.1.2.3.0

    Thank you
    Ashwin

    Published by: 989372 on April 24, 2013 08:22

    Hello

    1. set up the table for selection of rows multi
    2. If you initially created the unique selection table, delete the SelectionListener entry added by JDeveloper
    3. create a custom pointing to a managed bean selection listener
    4. in the selection listener, call getComponent on the selection event (http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/event/SelectionEvent.html) and cast to richeTableau
    5. on rich table Manager, call getSelectedRowKeys (http://docs.oracle.com/cd/E28389_01/apirefs.1111/e10684/oracle/adf/view/rich/component/rich/data/RichTable.html)
    6. If there is more than one key of the selected row, set a property of a managed bean (for example showTab) false and PPR Panel tab
    7 use the property "off" from the showDetailItem (http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_showDetailItem.html) to point to the property Boolean managed bean

    Frank

  • Add line before or after the selected line in af:Table

    Hello

    Please let me know how we can add a line before or after the selected line in the display: table.

    Currently I have a table with 2 buttons on toolbar. 1. Add 2. Add after.

    The user selects the row and click a button AddBefore and after... then, a blank line must have added in the table according to the clicked button.

    Please suggest me your entries.

    Thank you
    Kiran

    chk this
    http://mjabr.WordPress.com/2011/07/02/how-to-control-the-location-of-the-new-row-in-aftable/

  • SELECT - INNER JOIN / multi-table question

    I have a few pages where I can:
    register a new user
    Open as this user which brings me to a home page. from there I can go to 'my page' users where I can see their fine of the initial registry data. I have a link here where I can go to add to their additional profile data that I didn't want to bore in the original registration.

    It perfect all worked with the original test data, I've created in the database.

    After that I added the additional tables needed to feed the profile further I ran into trouble. I could create a new user, see in the database is fine. I see them on the homepage with their information through the Recordset. However when I'd go to their 'my page' none of their information would be fill and go to extra profile update page haven't fired a no records found message.

    Finally, I realized that the reason for this is because the SELECT statement is waiting for the other tables to fill. I filled in the missing data and the query to work. So... Now that I know what is causing the problem I need help to find a solution. Also, I'm still new to find work around me even after 4 days of research and reading messages.

    So when a new user registers, I need to be able to display data from the initial registration on the "my page" and get their user_id for profile tables add somehow so that when I go to the add profile page, there is a link.

    I don't know if I need to do something in the database or in my query. It there any sense to anyone? I need to create the user_id on other tables during registration of origin occurs? If so, how would I go all this?

    Thanks in advance. My INNER JOIN is attached in case it helps.

    I have a few pages where I can:
    register a new user
    Open as this user which brings me to a home page. from there I can go to 'my page' users where I can see their fine of the initial registry data. I have a link here where I can go to add to their additional profile data that I didn't want to bore in the original registration.

    It perfect all worked with the original test data, I've created in the database.

    After that I added the additional tables needed to feed the profile further I ran into trouble. I could create a new user, see in the database is fine. I see them on the homepage with their information through the Recordset. However when I'd go to their 'my page' none of their information would be fill and go to extra profile update page haven't fired a no records found message.

    Finally, I realized that the reason for this is because the SELECT statement is waiting for the other tables to fill. I filled in the missing data and the query to work. So... Now that I know what is causing the problem I need help to find a solution. Also, I'm still new to find work around me even after 4 days of research and reading messages.

    So when a new user registers, I need to be able to display data from the initial registration on the "my page" and get their user_id for profile tables add somehow so that when I go to the add profile page, there is a link.

    I don't know if I need to do something in the database or in my query. It there any sense to anyone? I need to create the user_id on other tables during registration of origin occurs? If so, how would I go all this?

    Thanks in advance. My INNER JOIN is attached in case it helps.

Maybe you are looking for