开发者

Oracle Apex 4 - Problem with PREVIOUS and NEXT, CLEAR Button Logic

开发者 https://www.devze.com 2023-02-04 09:19 出处:网络
I\'m trying to create a simple form where the last record created displays when the form is opened. Previous and Next buttons allow navigation through the table and Clear button allows you to clear th

I'm trying to create a simple form where the last record created displays when the form is opened. Previous and Next buttons allow navigation through the table and Clear button allows you to clear the screen and enter a开发者_如何学编程 new record.

I created a working page with a region that displays the data in the table.

I created two buttons called Previous and Next using the wizard (which do appear).

But the buttons don't allow do anything.

So I think I need a process that looks for a submit with the button names in the request but I am not sure what to put into them.

Also for Clear I'm stumped as well.

Thanks for any help.


You need to hold the primary key of the record being displayed in a page item (or items), and use these to find the record to use when populating the form. Then in the processes to handle the Next and Previous buttons you need code to detemine the primary key of the next/previous record and update the page items. Then when the page reloads the next/previous record will be displayed.

The code may be something like (for Next button process):

select empno
from emp
where empno = (select min(empno) from emp
               where  empno > :p1_empno);
0

精彩评论

暂无评论...
验证码 换一张
取 消