How to obtain the selected rows in the model with af:Table using selectMany

Hi ,
I am using multi select af:Table and it is based on a programmatically populated view. When the table is single select I can use the getCurrentRow at the view implementation. I wonder whether there is a way to get list of selected rows within the view implementation for the multi-select scenario.
I saw some ways of doing it in the page's backing bean but it will be more appropriate if I could do it at the model project.
Thanks
My environment is JDeveloper 10.1.3.3 and jdk 1.4

Thanks for your reply.
What you say makes sense. I thought there might be way of setting the selected rows in the model also as we do woth the current row.
But looks like these two different things.
Anyway I am doing it by passing the values through the backing bean.
Thanks

Similar Messages

  • V v urgent ...  how to get the selected rows in the vl02n transaction

    Hi ,
    I have requirement that i have selected the line items in the vl02n transaction.
    If I select only one row there is option gs_get_cursor-line.
    If I select more than one line item at a time I am getting only the last value in to gs_get_cursor-line.
    Can anybody let me know how to get the multiple line items  that are selected
    It is very urgent ..
    Plz Help

    Hi,
    can you check the E_row_id .
    v_row type LVC_S_ROW
    read table itab index E_ROW-index.
    regards,
    Ajay
    Edited by: Ajay on Feb 14, 2008 6:22 PM

  • How can I get the values of the selected row in the report?

    Hi All:
    I have a dynamic query(lexical parameters)that columns are selected at the run time. And depend on the values, I'd like to do another query just for certain row. For example, when I double click on the fifth column of the fifth row. I'd like to collect all the column values of this fifth row. I think It likes drill-down report, but I don't need a detail report. I just want a string of the combination column's values. Would you please help?
    Thanks, in advances, for your help.
    TD

    Hi:
    I got it.
    Thx,
    TD

  • Trapping the selected row in the table using boolean checkbox

    Hi,
    I am using Jdev 11.1.1.2.0 with ADF 11g.
    I have a screen that has a table with an additional column of 'Select boolean checkbox'. I have assigned a valuechangelistener method that helps me know which row has been selected. But the issue is it gets fired for all the rows in the table once I select/de-select a checkbox of 1 single row.
    How can I handle this? Yes I can iterate through the table rows and check the values of the checkbox. But that is not I want, I also want to trap the de-select event.
    What is the way to achieve this?

    Timo Hahn wrote:
    I don't see a bug in this behavior. This is because each row gets stamped when they render.
    The way to do this is to use an attribute (which can be transient) to hold the status of the check box. Exactly this does the link I gave.
    TimoHi,
    Why I am saying it as a bug is because it is not firing the event for the record where the event has occurred. instead the event is fired for each row which should definitely not what is expected. And because of this we have to add an additional variable.
    Now it becomes more complex if I have to handle de-selection as well, b'coz if the valuchangelistener is going to fire for all the records then I need to know which row was previously selected and now de-selected as now the de-selected record will also return a false.
    So any better solution, anyone?

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How to reference the selected row on a report by click a radiobox

    I created a report with a column displayed as a radiobox.The report source is like "select htmldb_item.radiogroup(1,.....),rec_id,....from .... where ....",after click one radiobox,i want to get other column's value in the selected row in the after submit process ,can anyone help me?????? how to reference "rec_id" of the selected row?

    Hello,
    First, please tell us your first name, and update your forum handle. It’s make it easier to track your threads, and help you.
    >> apex_application.g_f01(1)" only return the first record's rec_id,if i click radiobox in other rows,it returns the same result as click radiobox in the first row?
    The ‘G_F01’ is an array of values, so apex_application.g_f01(1) will always bring you the first element of this array. If you want to retrieve other values from this array, which will include the values of the radiogroup value of the other lines, you need to use a loop. Something like that should work:
    for i in 1.. apex_application.g_f01.count loop
    … apex_application.g_f01(i) …
    end loop;
    >> after click one radiobox,i want to get other column's value in the selected row in the after submit process
    That means that the value of your radiogroup item should include some indication to the line you are on. If, like in Andy’s example, you can retrieve your record from a table, based on a PK, your radiogroup can return this kind of information. However, if the data on the other columns of the select raw, were just entered/updated by the user (like in a tabular form), the radiogroup item should include information about the row you are in, in order for you to be able to access the corresponding array elements – other G-Fxx arrays – of the other columns in the row. In this case, I believe using checkboxes is preferable.
    Regards,
    Arie.

  • How to read the selected row value of a table node

    hi
    i have a node of table type, displaying few records & with each record a  NEXT button is there.
    now i want to read the values of the selected row of the table & want to process next with NEXT button.
    pls tell me how to read the values of the selected row only.
    reds.

    data : lo_nd type ref to if_wd_context_node,
      lo_nd1 type ref to if_wd_context_node,
      lt_temp type wdr_context_element_set,
      wa_temp type ref to if_wd_context_element,
      ls_node1 type sflight,
      lt_node1 type STANDARD TABLE OF sflight.
    lo_nd = wd_context->get_child_node('CN_MAIN').
      CALL METHOD lo_nd->get_selected_elements
       RECEIVING
           set = lt_temp.
      loop at lt_temp INTO wa_temp.
          CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_node1.
        APPEND ls_node1 TO lt_node1.
        CLEAR ls_node1.
      ENDLOOP.
    'CN_MAIN' is the node whose selected values are to be picked and stored in internal table lt_node1.
    Other option by Thomas :
    DATA lo_nd_cn_main TYPE REF TO if_wd_context_node.
      DATA lt_temp TYPE wdr_context_element_set.
      FIELD-SYMBOLS <wa_temp> LIKE LINE OF lt_temp.
      DATA lt_node1 TYPE wd_this->elements_cn_main.
      FIELD-SYMBOLS <ls_node1> LIKE LINE OF lt_node1.
      lo_nd_cn_main = wd_context->get_child_node( name = wd_this->wdctx_cn_main ).
      lt_temp = lo_nd_cn_main->get_selected_elements( ).
      LOOP AT lt_temp ASSIGNING <wa_temp>.
        APPEND INITIAL LINE TO lt_node1 ASSIGNING <ls_node1>.
        <wa_temp>->get_static_attributes( IMPORTING STATIC_ATTRIBUTES = <ls_node1> ).
      ENDLOOP.

  • How to delete or remove the selected row in a table

    Dear Experts,
    I'm facing a typical requirement in VC, similiar to variable selection screen in BI Queries :
    I will have two tabes and if the user selects data from one table it will be moved to target table.I'm able to populate the target table with the value but I'm not able to delete the selected row from the source table.
    Any help in this regard would be highlt appreciated.
    Thankx in advance.
    Regds,
    Srinivasan.

    Hi
    Follow the following steps -
    1. Create two buttons.One for 'delete row' and another one for 'insert row'.
    2. Assign the proper system action as per the name.
    2. Change the name of both buttons as common name.
    3. To trigger the actions simultaneously add a star before the action.( For Example : *select)
    4. Change the visibility of any one of the button as 'false'. (so it will not get displayed)
    5. Now, if u click the visible button both actions will be triggered simultaneously.
    Regards
    Sandeep

  • Getting the selected row from a datatable -- URGENT

    Hi,
    I am facing the following problem with a datatable. The datatable does not have any Input components like CommandLink, Buttons, Radio Buttons and Checkbox. Even I cannot use the hidden Command Link.
    One solution is to use a input hidden variable which can hold the curent row Id. But in this case too, how to get the control in a backing bean method is not clear to me.
    Please guide me how to get the data of the selected row in the backing bean.
    Thanks in advance......
    VJain.

    I again explain my problem:
    I need to get the Current Selected Row onclick of any row in a Datatable. But the datatable is restricted not to have any CommandLink or Input component so that I can generate the action to go to any method on a backing bean as shown below.
    <h:dataTable id="dTable" value="#{Bean.myList}" var="currentRow" >
    <h:column id="row1">
    <h:outputText value="# currentRow.productNumber}"></h:outputText>
    </h:column>
    <h:column id="row2">
    <h:outputText value="# currentRow.productName}"></h:outputText>
    </h:column>
    </h:dataTable>
    As shown above I cannot use any commandButton or CommandLink to submit the page. All I can do is to generate any onclick function on Table and do something with it. But not sure how to do it.
    Now I want the productNumber of the selected row in any method say getCurrentRowId of the Bean.
    I hope the problem must be clear now....
    Thanks for your quick reply..
    VJ

  • After upgrading to CF10, the selected row of my cfgrid is no longer passed on form post.

    I have a cfform which contains a cfgrid and prior to the 9 to 10 update, upon submission of the cfform, the selected row of the grid was passed/posted to my form action page as:
    __CFGRID__gridForm__renewalGrid
    This contained all the data from the selected row, I.e.:
    __CFGRID__COLUMN__=PROJECTID; __CFGRID__DATA__=T01081002AP; __CFGRID__COLUMN__=APPLICATIONS; __CFGRID__DATA__=PQFD; __CFGRID__COLUMN__=OWNERUID; __CFGRID__DATA__=HT2008; __CFGRID__COLUMN__=TEAM; __CFGRID__DATA__=Roberts; __CFGRID__COLUMN__=ROLE; __CFGRID__DATA__=AASBOAPMX; __CFGRID__COLUMN__=REGION; __CFGRID__DATA__=Southwest; __CFGRID__COLUMN__=EXISTING; __CFGRID__DATA__=K8045F; __CFGRID__COLUMN__=SOD; __CFGRID__DATA__=0; __CFGRID__COLUMN__=INITIALEMAILDATE; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=MESSAGEDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=SECONDEMAILDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=ESCALATIONDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=COMPLETEDBY; __CFGRID__DATA__=TH2878; __CFGRID__COLUMN__=COMPLETIONDATE; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MONTHPULLED; __CFGRID__DATA__=Jan2013; __CFGRID__COLUMN__=TOTALITEMS; __CFGRID__DATA__=2; __CFGRID__COLUMN__=RELIEVINGPSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=MODIFIEDBYTS; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MODIFIEDBY; __CFGRID__DATA__=T228Y8; __CFGRID__COLUMN__=CREATEDBY; __CFGRID__DATA__=KV3M36; __CFGRID__COLUMN__=CREATEDTS; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=NEWSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=DELEGATESTATUSNOTE; __CFGRID__DATA__=Access; __CFGRID__COLUMN__=STATUS; __CFGRID__DATA__=Completed; __CFGRID__COLUMN__=DATATYPE; __CFGRID__DATA__=Appl New
    After upgrading to CF10, and with no changes to the code, performing this same process, __CFGRID__gridForm__renewalGrid is still passed in the form scope to my action page, but now it is empty.
    I have not yet uninstalled CF9, so I brought it up on a different port, and I can run the same code as CF9 or CF10 and watch... in 9 the selected row is passed, in 10 it is empty.
    Is this a bug? Is there a work around? Please help.

    appears that apple has changed SMB code, and now its not possible login from windows on mac.
    i installed snow leopard and now works fine.
    apple is capable to make it run paying new license of smb code, but isnted of this, apple has created new protocol smbx and now, all others need to adapt your code to apple..
    bad movement.. i am thinking sell imac and no back to apple anymore..

  • Enable/disable operation buttons according to the selected row in table?

    Hi,
    I used JDev 11.1.1.2.0
    On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
    I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
    The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
    Table code like:
    <af:table value="#{bindings.VO1.collectionModel}" var="row"
    rows="#{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 buttons code like:
    <af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
    Any suggestion will be great help.
    Thanks,
    zeroxin

    Hi,
    create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
    #{bindings.statusField.inputValue=='value'}
    Frank

  • Select Table row(eg.3rd),rows displayed from the selected row,hiding above

    If we move the horizontal scroll bar of the table and filter a column when there is a selection on the row, the rows are displayed from the selected row. The rows above the selected rows are disappearing(F5 it come back) and the rows are available when there are more rows with vertical scroll bar(above the selected row, if we scroll up).

    Frank,
    Mailed to you the sample application with the table script too. Please review the comments in the mail.
    Thanks and Regards,
    Stanley William
    Edited by: STANLEYWILLIAM on Apr 22, 2013 3:52 PM
    Edited by: STANLEYWILLIAM on Apr 22, 2013 3:52 PM

  • Looping the selected row in JTable

    By default, when the first row in a JTable is selected and the up arrow is pressed, the first row remains selected. What I need in this case is the selected row to change to the last row in the table, in effect creating a circular selection. I might have missed something in the API, but is there a way to (easily) change the default selection behavior?
    I have thought of adding a listener that would select the last row when the up arrow is pressed and the first row is selected, but it seems like a hack. Searching the web has provided little to no help.
    Does anyone know of an elegant way to do this? ...or can anyone provide any links that could be of help?
    Thanks!
    Glenn

    Thanks for the help! I made some minor changes to the code you provided because it was not allowing me to select the first and last row (it just skips them). Also, the row that is selected must be in edit mode in order for it to work.
    Here is the modified code. For simplicity, I just put the operations for the up and down arrow in the same method.
      protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
                                          int condition, boolean pressed) {
        // if pressed == false, no looping is needed, so perform default action
        if (!pressed)
          return super.processKeyBinding(ks, e, condition, pressed);
        // up arrow
        if (e.getKeyCode() == KeyEvent.VK_UP) {
          // if the current selected row is 0 or less, then loop.
          if (this.getSelectedRow() <= 0) {
            // if the cell is in edit mode, stop editing
            if (this.getCellEditor() != null)
              this.getCellEditor().stopCellEditing();
            int rowCount = this.getModel().getRowCount();
            this.getSelectionModel().setSelectionInterval(rowCount-1, rowCount-1);
            return true;
          } else {
            return super.processKeyBinding(ks, e, condition, pressed);
        } else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
          // if the selected row is the last row, then loop
          if (this.getSelectedRow() >= (this.getModel().getRowCount() - 1) ) {
            // if the cell is in edit mode, stop editing
            if (this.getCellEditor() != null)
              this.getCellEditor().stopCellEditing();
            // loop the selection to the first row
            this.getSelectionModel().setSelectionInterval(0, 0);
            return true;
          } else {
            return super.processKeyBinding(ks, e, condition, pressed);
        } else {
          return super.processKeyBinding(ks, e, condition, pressed);
      }The above code does not attempt to restore the editor component when a new row is selected like the code you provided.
    Thanks again for providing such a thorough example!

  • Getting selected row for command link in af:table

    Hi
    I have a h:commandLink in a column of my af:table. When it is clicked, I need to get the selected row data.
    I know the documentation says use setCurrentRowValue method, but I am not using the Data Control Palette - I get the data fromt the database using code in the BackingBean.
    Is there any other way? Pls help.

    Yes, I got it. But my method gets the data in the selected row, not the rowKey
    First I used af:commandLink instead of h:commandLink and then used af:setActionListener based on an example in the jDeveloper Help. I had to change it a bit since I am not using DCP or bindings.
    This is the sample from Help, hope it helps!
    SF Page Code for a Command Link Using a setActionListener Component <af:commandLink actionListener="#{bindings.setCurrentRowWithKey.execute}"
    action="edit"
    text="#{row.svrId}"
    disabled="#{!bindings.setCurrentRowWithKey.enabled}"
    id="commandLink1">
    <af:setActionListener from="#{row.svrId}"
    to="#{userState.currentSvrId}">
    </af:commandLink>

  • How to change the default color of the selected row

    hi all,
    I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet.
    thanks and regards,
    rpk

    The chart colors are being referred to *'palette.cxml'* file in these directories
    BI_HOME\web\app\res\s_oracle10\chartsupport
    BI_HOME\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\chartsupport
    you can change to your custom colors.
    Restart OC4J and PS to make the new ones work..
    Regards,
    Raghu

Maybe you are looking for