Hi all,

I wanted to setfocus back to the current row and column after issuing an executequery command in a grid. I issued the following commands. However, this is not working as the rowid changes after every execute query command and therefore setcurrentrow command will not work correctly. Can you kindly suggest me an alternative solution?

PROCEDURE refreshgrid IS
   l_focused_item  VARCHAR2(100);
   l_ds            VARCHAR2(200);
   l_rowid         NUMBER;
BEGIN
   l_focused_item   := api_application.getfocusedcomponent('Y');
   l_ds             := api_component.getdatasource(l_focused_item);
   l_rowid          := api_datasource.getcurrentrowid(l_ds);
   --
   api_datasource.executequery(l_ds, NULL);
   --
   api_component.requestfocus(l_focused_item);
   api_datasource.setcurrentrow(l_ds, l_rowid);
END;

With regards.

George

asked 05 Apr '14, 04:24

grajan777's gravatar image

grajan777
1011238
accept rate: 10%

edited 05 Apr '14, 08:51


Hi George,

I guess you will need to get the primary key value of the row, so you can return to the row after executequery using api_datasource.setcurrentrowbypk
You can combine it with api_datasource.getpkcolumnname to get the PK column for the datasource and use that to get the columnvaluenr of the PK column.

Best regards,
Michiel

link

answered 08 Apr '14, 10:45

Michiel%20A's gravatar image

Michiel A
5161749
accept rate: 13%

Hi Michiel,

Thank you. I will check it.

George.

(08 Apr '14, 10:48) grajan777
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:

×8
×1
×1

Asked: 05 Apr '14, 04:24

Seen: 914 times

Last updated: 08 Apr '14, 10:48


© Copyright Gerger 2017