How do add a button to go back to another page in oracle apex interactive grid

这一生的挚爱 提交于 2019-12-08 09:40:03

问题


I want to add a customized button in oracle apex interactive grid to allow users to go back to the previous page. Can someone explain how I can do this in javascript? Thanks


回答1:


You can use history.back() or if you want to go multiple steps back history.go(-2)




回答2:


Without javascript (recommended):

  1. Create your button, let's say BTN_PREVIOUS, and a hidden page item, P1_PREVIOUS_PAGE
  2. Create a new branch:

Point: After Porcessing

Behavior Type: Page Identified by Item (Show only)

Item: Select your hidden item created on step 1 (P1_PREVIOUS_PAGE)

Server-side Condition: When Button Pressed, BTN_PREVIOUS

Now for every page that calls this one, you have to set the item P1_PREVIOUS_PAGE with the number of the calling page. There's innumerable ways to to this (through declarative list entries, URL, javascript), I recommend you to read https://docs.oracle.com/cd/E59726_01/doc.50/e39147/concept_url.htm

Obs: if you do the steps above, make sure that every other process, computation and branches have a server side condition, because this method relies on submitting the page and you don't want your "Previous" button triggering any other logic that you have already created.


With javascript:

  1. Create your button, let's say BTN_PREVIOUS;
  2. Create a dynamic action

When: Event: Click

Selection Type: Button

Button: BTN_PREVIOUS

Inside the dynamic action create a true action:

Action: Execute JavaScript code

Code: history.back()

Although the javascript way is simpler, it's always preferable to use what the tool (APEX) has to offer.



来源:https://stackoverflow.com/questions/57103876/how-do-add-a-button-to-go-back-to-another-page-in-oracle-apex-interactive-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!