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

}

Tags: Java

Similar Questions

  • Getting a value from all the selected lines in the method of the AM

    Hi all

    I use JDev 11.1.1.4.0

    I have a table with the selection of several lines. In my module application I want to call a stored procedure with the parameter whose value depends on the selected line in the table.
    For the only selection I can make fallow:
        public void wypiszId() {
            ViewObject vo = findViewObject("ProcsklView1");
            String st = vo.getCurrentRow().getAttribute("IdProcskl").toString();
            System.out.println(st);
    How can I deal with multiple selection?

    Kind regards
    Wojtek.

    Hello

    VO/iterator will hold only selected line at a time. Thus, for multi table enabled selection, the last selected line would be the selected line (vo / Iterator). In order to obtain all the selected lines, you must obtain support bean by linking the Table of the ADF.

    Check out this blog on this goal.

    http://blogs.Oracle.com/aramamoo/2010/12/getting_all_selected_rows_in_adf_table_with_multiple_rows_selection_enabled.html

    Arun-

  • [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

  • 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/

  • Enter the selected line only an editable af:table ADF

    Hello

    We have an obligation to engage only the selected lines in a table. All lines in the table must be modifiable. There should be a 'Save' button in a column that has to save the selected line when you click it.

    Could you please share your comments/suggestions.

    Environment:

    JDeveloper and ADF 11.1.1.7

    Thank you

    Srikanth

    Maybe you can add the attribute transitional to EO as an indicator whether the line should be validated in db or not, override EOImpl.doDML () and skip super.doDML () If this attribute is not set.

    Dario

  • Restore the value of the selected line in the editable Table.

    Hello, I use Jdeveloper 11.1.2.1.0.

    My problem is:
    1. Select a line in the editable table.
    2. change the value inside elements of the af:inputText of columns.
    3. tap on restore.
    4. the values of the selected line remains the same.

    If I select another line, before the restore, the restore will work as expected.

    I want to when you press the button cancel the values of the selected row to be rollback-ed as well.

    Set the immediate on all the inputTextFields in the table and it worked.

    Thank you.

  • Toggle buttons control according to the selected line in the table?

    Hello

    I have used JDev 11.1.1.2.0

    On my main page, it has a query section and view the result to a component of the lookup table and also has functioning as (update/deletion) buttons in the toolbar.

    I want to toggle buttons operating according to some value of the selected line in the table, and I searched on the OTN forum, found more than issues like that, but seemed no found a good solution.

    The table is a unique and has a status column selection, its data type is integer, and I want to activate the buttons when the value of the status field of the selected line is 0 or 1, disable the buttons when the State value is other values.

    Code of the table as:

    < af:table value = "#{bindings." Var VO1.collectionModel}"="row ".
    lines = ' #{bindings. " VO1.rangeSize}.
    emptyText = "#{bindingsVO1.viewable?" '} ". No data to display. ': 'Access Denied. »} »
    fetchSize = "#{bindings." VO1.rangeSize}.
    rowBandingInterval = '0 '.
    filterModel = "#{bindings." VOCriteriaQuery.queryDescriptor}.
    queryListener = ' #{bindings. " VOCriteriaQuery.processQuery}.
    filterVisible = "true" varStatus = "vs."
    selectedRowKeys = ' #{bindings. " VO1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." VO1.collectionModel.makeCurrent}.
    rowSelection = "single" id = "resId1" >

    Operation code buttons like:
    < af:commandToolbarButton text = "Update" id = "ctb2" action = "editDAF" / >

    Any suggestions would be very helpful.

    Thank you
    zeroxin

    Hello

    bind to the attribute in the PageDef file for the status field. Then configure the PartialTriggers property button to point to the ID of the table. Of the disabled button property then points to the status as attribute link

    #{bindings.statusField.inputValue == 'value'}

    Frank

  • ADF Table - View column value of the selected line, need help

    Hi all

    I am newbee in ADF and needed to get the value of the column in the selected line in ADF inputTest.
    (I tried to navigate link without success)

    Pls tell me is it possible without coding, that is to say using partialTrigger etc.

    Please indicate the steps to follow.


    Thank you
    Amit

    Hello

    I'm not clear on your condition, where is your inputtext, is it inside the table or just outside the table?

    From my understanding, I realized that you have a table and a text entry next to the table where you want to display the value of a particular column of a selected line. That's what you're looking for (in which case above suggested solution works) or something different?

    Jean Lou

  • ADF table selected displayRow does not display the selected line

    Hello

    JDev 11.1.2.4

    I have a table with selection enabled and displayRow property the value selected. In the workflow, I have an ExecuteWithParams activity, and then a method activity that restores the current iterator of the line. Finally the activity view that displays the table.

    Restore the current line with key

    Iterator DCIteratorBinding = ADFUtils.findIterator ("MyIterator");

    iterator.setCurrentRowWithKey (currentKey); currentKey is a string

    The question I have is that the current line is properly restored, but the table does not display the page of "range" of the current line while the displayRow is the selected value. My table has 500 rows, the table displays the top 25 while the current line is the 500th line. I expect the table to display the line 475 to 500 line.

    What I am doing wrong?

    Thank you

    You can save the index lines before executing your method and then set the iterator to this index.

    The technique is described in this blog https://tompeez.wordpress.com/2016/02/12/naviagting-an-aftable-in-pagination-mode-from-a-bean/

    Timo

  • How can I default first line below the selected line in the table of the adf

    Hello

    I use Jdeveloper 11 g,
    I created Adf quick query with table and changed selectionListener table as #{CustRMMap.onRMGroupNameChange}.
    and when I click on find fast query no row is selected.
    I want the first row to be selected / highlighted by default when I click search.

    Patel Imran

    You can also set an attributeValue in pagedef.xml
    bind this attributeValue with column of your table. This sets the value of the selected line to the variable attruibute.
    Will now link this with your desired component attributeValue.
    Put partial trigger on the component that should display this value.
    This will save you to write custom code and use the default table selection listener property, which marks the first default line.

    Apart from this, if you want to govern the first default line of managed bean selection use this code...

    + _Table = selectionEvent.getSource ((richeTableau)) richeTableau; + *
    + / / the model in the Collection is the object that provides the structured data.
    + / / for rendering table +.
    + TableModel CollectionModel = table.getValue ((CollectionModel)); + *
    + / / the ADF object that implements the CollectionModel is JUCtrlHierBinding. IT +.
    + / /is wrapped by the CollectionModel API.
    + JUCtrlHierBinding adfTableBinding = tableModel.getWrappedData ((JUCtrlHierBinding)); + *
    + / / Acess the iterator ADF, binding that is used with the binding table ADF +.
    + DCIteratorBinding tableIteratorBinding = adfTableBinding.getDCIteratorBinding (); + *

    + / / the role of this method is to synchronize the table feature selection +.
    + / / with the selection of the model of the ADF +.
    + Object selectedRowData = table.getSelectedRowData (); + *
    + / / cast of JUCtrlHierNodeBinding, which is the subject of the ADF that is +.
    + / line/a +.
    + JUCtrlHierNodeBinding nodeBinding = selectedRowData (JUCtrlHierNodeBinding); + *
    + / / get the key of the node binding line and set it as the current line in the +.
    + / / iterator +.
    + Key rwKey = nodeBinding.getRowKey (); + *
    tableIteratorBinding.setCurrentRowWithKey (rwKey.toStringFormat (true)); + *

    and another way on the right is a custom like this code:

    + public void setDefaultRow (int count) {/ / call this method your method of selection custom, rom pass the line of the line to select index. count = 0, will select first row + *}

    + try {+ *}
    Object oldRowKey = tblMag.getRowKey (); *
    + try {+ *}
    This.

    .getSelectedRowKeys () .clear ();
    *
    * +} catch (System.Exception e) {+ *}
    System.out.println (e.getMessage ()); *
    +}+
    This..setRowIndex (count);
    *
    RKS RowKeySet =. getSelectedRowKeys();
    *
    (RKS). Add(. getRowKey());
    *
    RKS =. getSelectedRowKeys();
    *
    +.setRowKey (oldRowKey); +

    * +} catch (System.Exception e) {+ *}
    System.out.println ("error:" e.getMessage ()); + *
    +}+
    +}+

    Hope this helps

    Concerning
    Maryline Roussel

  • Highlight on the selected line disappear when af:table lose focus?

    Hello

    I have a strange problem:
    I have an af:table select single line based on the VO and an af:inputText in a jsf page.
    When I select a row in the table, then click on in the inputText at the entrance, the highlight on the selected line in the table disappear!
    The currently selected line is always a controlled beans, but it seems that it is not that any line is selected in the user interface.
    Is this a bug of af: table?

    My test page:
    < af:form id = "f1" >
    < af:panelGroupLayout id = "pgl1" layout = "scroll" >
    < af:table value = "#{bindings." Var ViewObj1.collectionModel}"="row ".
    lines = ' #{bindings. " ViewObj1.rangeSize}.
    emptyText = "#{bindings." ViewObj1.viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." ViewObj1.rangeSize}.
    rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " ViewObj1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." ViewObj1.collectionModel.makeCurrent}.
    rowSelection = "single" id = "t1" >
    < af:column sortProperty = "EmpDeptid" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpDeptid.label}.
    ID = "c8" >
    < af:outputText value = "#{rank." EmpDeptid}"id ="ot3">
    < af:convertNumber groupingUsed = "false".
    model = ' #{bindings. " ViewObj1.hints.EmpDeptid.format}"/ >
    < / af:outputText >
    < / af:column >
    < af:column sortProperty = "EmpHireDate" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpHireDate.label}.
    ID = 'c4' >
    < af:outputText value = "#{rank." EmpHireDate}"id ="ot7">
    < af:convertDateTime pattern = "#{bindings." ViewObj1.hints.EmpHireDate.format}"/ >
    < / af:outputText >
    < / af:column >
    < af:column sortProperty = "EmpId" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpId.label}.
    ID = "c7" >
    < af:outputText value = "#{rank." EmpId}"id ="ot6"/ >
    < / af:column >
    < af:column sortProperty = "EmpJob" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpJob.label}.
    ID = "c1" >
    < af:outputText value = "#{rank." EmpJob}"id ="ot1"/ >
    < / af:column >
    < af:column sortProperty = "EmpLineid" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpLineid.label}.
    ID = "c5" >
    < af:outputText value = "#{rank." EmpLineid}"id ="ot4">
    < af:convertNumber groupingUsed = "false".
    model = ' #{bindings. " ViewObj1.hints.EmpLineid.format}"/ >
    < / af:outputText >
    < / af:column >
    < af:column sortProperty = "EmpSex" sortable = "false".
    headerText = "#{bindings." ViewObj1.hints.EmpSex.label}.
    ID = "c6" >
    < af:outputText value = "#{rank." EmpSex}"id ="ot2"/ >
    < / af:column >
    < / af:table >
    < af:panelFormLayout id = "pfl1" >
    < f: facet = 'footer' name / >
    < af:inputText label = "Label 1" id = "it1" / >
    < / af:panelFormLayout >
    < / af:panelGroupLayout >
    < / af:form >

    Thank you
    660

    Hello

    This seems an expected behavior of the skin of the merger.
    The selected line inactive thoroughly clear yellow that is hard to recognize on some screens.

    solution:
    create a custom look (extend the skin of 'fusion') and create css, like this:
    AF | : the table-row data: selected: inactive af | : given the column cell.
    AF | : the table-row data: selected: inactive af | column: banded-data-cell
    {
    background-color: blue;
    }

    concerning
    Peter

    Published by: hofespet on November 6, 2010 12:45

  • How to create the map that updates only the changed lines

    Hello

    I have a map that made a merger (update/insert) in a table. The problem is that it will always update all rows in this table. I want to update only the changed lines.

    Some dummy code that shows what I want to do.
    Current situation (all lines updated):

    FUSION
    IN
    Table 1-t1
    USING
    (select key_column, Column1, Column2 from table2) t2
    ON)
    T1.key_column = t2.key_kolumn
    )

    WHEN MATCHED THEN
    UPDATE
    SET
    T1. Column1 = t2.column1
    T1. Column2 = t2.column2
    WHEN NOT MATCHED THEN
    INSERT
    (t1.key_column, t1.column1, t1.column2)
    VALUES
    (t2.key_column, t2.column1, t2.column2);

    What I'm trying to get (only changed the lines updated):
    FUSION
    IN
    Table 1-t1
    USING
    (select key_column, Column1, Column2 from table2) t2
    ON)
    T1.key_column = t2.key_kolumn
    )

    WHEN MATCHED THEN
    UPDATE
    SET
    T1. Column1 = t2.column1
    T1. Column2 = t2.column2
    * WHERE
    T1. Column1! = t2.column1
    or t1.column2! = t2.column2*
    WHEN NOT MATCHED THEN
    INSERT
    (t1.key_column, t1.column1, t1.column2)
    VALUES
    (t2.key_column, t2.column1, t2.column2);

    WHERE in WHEN MATCHED t clause is that I'm not able to create via OWB in the mapping. How is that possible?
    I tried to look for the solution here and google without success

    Thank you!

    Hello

    you left outer join table2, with table1. Then use a filter to determine which rows in which an attribute has changed or no towing in table1 where found.
    To compare attributes use expression with nvl to properly handle nulls: nvl(table2.my_attribute,'#')! = nvl(table1.my_attribute,'#')

    Kind regards
    Carsten.

  • Multiple selection query to view the selected line

    Hi all

    I have a requirements make multiple selection of a region in the table and need to display the values of the selected line in the page.

    so I'm able to multiple selection of the table, but all when trying to print the values, it is still only printing selected values of line one not several.

    the code I use to print several rows below the selected values.

    for (int i = 0; i < fetchedRowCount; i ++) {}
    Rowi ABCEOViewRowImpl =
    (ABEOViewRowImpl) selectIter.getRowAtRangeIndex (i);

    If (rowi! = null) {}
    If (Y".equals (rowi.getReprint ())) {" "}
    for (int j = 0; j < fetchedRowCount; j ++) {}
    String srnum = rowi.getSerialNumber ();

    throw new OAException ("after Srno" +)
    srnum,
    OAException.INFORMATION);
    }
    }
    }
    }

    where fetchedrowcount - no lines in the region of the table
    Here srnum is printing only one value.

    Please guide me where to check this problem.

    Thank you
    Deb

    Hi Deb,

    Unable to get the requirement. Why the second for loop... ?

    Still, the OAException must be thrown exception during the first use that meets the condition.

    Please try to use "srnum" in tabular or use it to add all the required values in the for loop and finally throw the exception.

    Concerning
    Sanujeet

  • always fill the last line of a table (which may expand)

    Hi, I have problems with a button in the table A that adds a line to another table (table B) and then fills automatically some row of the table (table A) data in the newly created line in the other table (table B)

    Here is my code (then) - I should also mention that table A has a button to add several lines to itself:

    It works almost - however, it does that if the amount of lines in every game table - which they are not necessarily that the user may or may not opt to add the row of the table has to table B. eg. A table might be deep 4 rows, but the table B can have only 2 rows.

    tableB.row.addInstance (0);

    vCol1 var = this.resolveNodes ("tableA.row.cellA");

    vCol2 var = this.resolveNodes ("tableB.row.cellA");

    vCol3 var = this.resolveNodes ("tableA.row.cellB");

    vCol4 var = this.resolveNodes ("tableB.row.cellB");

    for (var I = 0; vCol1.length i < ; I ++) {

    vCol2.item (i) .rawValue = vCol1.item (i) .rawValue;

    vCol4.item (i) .rawValue = vCol3.item (i) .rawValue;

    }

    I'm new to scripting (learning on the fly), so my question is, given that the first command is to add a new row to table B, can I change the code so that vCol4 and vCol2 var are always the very last line created? In this way, all the previous lines that have been added will be shunt down in the list and will not be affected, but click on the new button? Or is there a better way to do this.

    Hello

    I think the key here is that the addInstance method returns the line he simply added.  If your add-in can be something like;

    var button = xfa.host.messageBox ("' you are about to ADD this entry in the Table B. would you continue?", "add to table B Section"1, 2 "");

    If (button is 4)

    {

    newRow = tableB._tableBrow.addInstance var (0);

    newRow.cellA.rawValue = cellA.rawValue;

    newRow.cellB.rawValue = cellB.rawValue;

    }

    I don't know how you want that table a delete button to work?  Should you remove the first row B of the table with a cellA and corresponding cellB?

    Concerning

    Bruce

  • The line of the last line of each table page is going to be missing.

    Hi Experts,
    In OBIEE 11.1.1.6.0, I have a report contains more than one line. "When I click on" PDF "Print", the last line of each table page line will be missing. " Why?
    Are you facing the same case? How soluve this question? Thank you.

    Hey Kobe,

    The question, looks lke a bug. Here's the work around, change the table view, click the properties of content next to the text "Table" (at the top of the columns and measures) in the layout-> position In Border pane to choose custom and select only the bottom edge (horizontal line). Now export to pdf format, you must see the border for the last row on each page.

    Kind regards
    DpKa

Maybe you are looking for