Hi,

I want to create a multi select LOV, so I built a dialog with a grid, search field and OK/Cancel buttons, and have set attribute selectionType="SelectMultiple" on the grid. So now i am able to select multiple rows in the grid, but how do i get the selected row ID's after pressing the OK button?

Thanks, Michiel A.

asked 11 Jun '12, 06:31

Michiel%20A's gravatar image

Michiel A
5161648
accept rate: 13%

edited 11 Jun '12, 06:32


Row_ids are arbitrary numbers generated from a sequence. Can you please try the below code, does it explain your question?

procedure getSelectedRowIds is
  v_selRowIDs_t api_component.tt_selectedRows;
begin
  v_selRowIDs_t := api_component.getSelectedRowIDs(aut_groups_lov.groupsGrid);
  for i in v_selRowIDs_t.first..v_selRowIDs_t.last loop
    api_application.showpopupmessage(
      api_datasource.getcolumnvaluetx(
        in_datasourcedotcolumn_tx => 'aut_groups_lov1.groupName',
        in_row_id => v_selRowIDs_t(i)));
  end loop;
end;
link

answered 11 Jun '12, 09:30

Ugur%20Kocak's gravatar image

Ugur Kocak ♦
5616
accept rate: 23%

Thanks, it works now. I was referencing i instead of v_selRowIDs_t(i)... :~/ must be monday..

(11 Jun '12, 09:45) Michiel A

Hi Michiel,

You can use api_component.getSelectedRowIDs
It returns the array of datasource row ID's which are selected.

link

answered 11 Jun '12, 06:37

Ugur%20Kocak's gravatar image

Ugur Kocak ♦
5616
accept rate: 23%

Hi Ugur,

I tried but i cant get it to work yet.

  • I created a grid with name="groupsGrid"
  • in the grid i show a textfield name="groupName", and in the grid is a hidden id field name="id"

Then I retrieve the rowIDs into a type tt_selectedrows variable with: api_component.getselectedrowids(in_paneldotcomponentname_tx => 'aut_groups_lov.groupsGrid')

I retrive an array with ID's, but they are always 1,2,3 etc, although i dont always select the first rows. When i use these array ID's and try to retrieve the groupName value from the row, like: api_datasource.getcolumnvaluetx(in_datasourcedotcolumn_tx => 'aut_groups_lov1.groupName' ,in_row_id => 1) , then I get the error "Invalid row id "1"."

What am i doing wrong?

Thanks, Michiel

link

answered 11 Jun '12, 07:16

Michiel%20A's gravatar image

Michiel A
5161648
accept rate: 13%

edited 11 Jun '12, 07:16

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×3
×1
×1
×1

Asked: 11 Jun '12, 06:31

Seen: 2,337 times

Last updated: 11 Jun '12, 09:45


© Copyright Gerger 2017