Hi folks,

I would like to ask for an advice.

I have a below scenario:

  1. We have a standard grid with paging
  2. We create a new record on detail form - on confirmation it adds a new record into grid's datasource

3.I would like to have this record in grid selected, once detail is confirmed. This is OK, when new record appears on first page, problem is when some sorting is enabled [or filters] and new record is not listed on first pagination page.

How to set a pagination to page where a newly created record is displayed, so it could be selected? Any suggestion, or other workaround which will always select a newly created record in grid (which could be also on other than first page)

Thanks, Tomas

asked 08 Dec '13, 10:32

Tomeo's gravatar image

Tomeo
162147
accept rate: 3%


Hi Tomas,

To accomplish this, you should calculate the page number of your newly created record. Then, you can navigate to this page using the api_datasource.setPage API and set the newly created row as current using api_datasource.setCurrentRow API.

Regards,
Ibahim

link

answered 10 Dec '13, 12:09

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Hi Ibrahim,

thanks for reply.

Getting information about on which page is a newly created record is not a simple task, as it depends on last user conditions set (applied) in active grid - it could be some filtering, sorting, etc, ...

Any suggestions?

How do you do it in your application?

Thanks, Tomas

link

answered 13 Jan '14, 16:08

Tomeo's gravatar image

Tomeo
162147
accept rate: 3%

Hi Tomas,

You could insert the new row in the grid current page, before the current row. That way the page never changes for the new record will always be on the current page. It is just that if you sorted the datasource, the row just gets inserted before the current row, so sorting will be incorrect..

Create a new row before the current one like this:

l_row_id := api_datasource.createrow (in_datasourcename_tx => 'datasource'
                                       ,in_nextsiblingrow_id => api_datasource.getcurrentrowid ('datasource')
                                       );

Just an idea....

Best regards,
Michiel

link

answered 14 Jan '14, 14:01

Michiel%20A's gravatar image

Michiel A
5161544
accept rate: 13%

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:

×4
×4
×1

Asked: 08 Dec '13, 10:32

Seen: 1,012 times

Last updated: 14 Jan '14, 14:01


© Copyright Gerger 2017