how to pass value from one page to another page in oracle apex 5.0? - oracle

I have two form pages 3 and 4. I want to pass the value for item: P3_LOT_N in page 3 to item: P4_LOT_N in page 4 when the button "Next" is pressed. How can I do this in oracle apex 5.0? Please help. Thank you.

Here's how:
open NEXT button's properties
under "Behavior", set "Action" property to "Redirect to page in this application"
click the button next to the "Target" (currently, it says "No link defined")
in a modal window that opens, target page will be Page 4
in "Set items" section, set "Name - value" pair (i.e. set P4_LOT_N to accept P3_LOT_N value)
That should be all.

If you do this via a "Redirect to page in this application", then the other form values you have on page 3 will not be POSTed to session state.
There are at least a couple other ways you could accomplish this:
You could simply have the Source of item P4_LOT_N be P3_LOT_N.
You could define a computation on page 3, to set P4_LOT_N to P3_LOT_N.

Related

Oracle Apex: how to link an item in a normal page to an item on a modal page

This is my issue: I have a text field item in a normal page (P7_PRODUCT), in this page there is a button that opens a modal page and, in the modal page there is another text field item (P7_PRODUCT). I would like that when I write a product in P7_PRODUCT, the same product appears in P8_PRODUCT. I tried with several dynamic actions, but none of them worked.
Here's one option.
on page 7, there are: P7_PRODUCT text item and P7_GOTO_8 button
let button Submit the page
create branch
name it e.g. "Goto 8"
it should redirect to page 8
in "Link Builder", set P8_PRODUCT item to &P7_PRODUCT. (note leading ampersand and trailing dot)
run page 7
enter something into the P7_PRODUCT item
press the button
modal dialog page opens and its P8_PRODUCT contains value you entered on page 7
A good blog to read is this one, by John Snyders from the apex development team. As he explains, it's not advised to branch to a modal dialog - instead you should link to it.
Here is an example based on techniques described in [this] (https://jeffkemponoracle.com/2022/02/reusable-region-as-a-modal-page/) blog.
I have 2 pages: Page 108 (normal page) and page 109 (modal page). Page 108 has a region (Region 1) with page item P108_NEW and a button called TO_MODAL. Page 109 has page item P109_NEW. When a user enters a value in P108_NEW and clicks the button, page 109 should open with the value from P108_NEW shown in P109_NEW.
The technique generates the url of the modal page and then redirects to it.
Give the region on page 108 a static id: "region1". This is used if you want to create a dynamic action on close of the dialog.
Create a new hidden item on page 108 (P108_URL_TO_MODAL1) to hold the value of the modal page url. Source type: Expression, source:
apex_page.get_url(
p_page => 109,
p_triggering_element => '$(''#region1'')'
)
Make sure to set "Used" to "Always, replacing any existing value in session state".
Create a dynamic action on click of button on page 108.
Add an action to the dynamic action of type pl/sql to set the value on page 109.
Action 1: Execute Server-side Code, Pl/SQL Code:
:P109_NEW := :P108_NEW;
Values to submit: P108_NEW
Action 2: Execute Javascript code:
apex.navigation.redirect("&P108_URL_TO_MODAL1.");
This should be it.

Oracle apex value of item is not up-to-date in button link builder when using redirect to another page

I have a value of a field on page 1 that I need to pass to page 2 (modal dialog).
The field is changed on page 1. and I can see it's got updated on the page and when I print its value in debug messages.
When I'm clicking the button, with the action "Redirect to Page in application", the value on page 2 is the initial value of the field, and not the updated one, is this a bug?
what can I do?
I don't want to use dynamic action or things like "prepare_url" because of many reasons.
Thanks.
That is not how a link works. What you are seeing is not a bug, it is expected behaviour. The link is rendered when the page is rendered and will have the item values at render time and a calculated checksum (depends on settings) based on those values. It will not pick up any changes.
The "traditional" way to do this is the following. Assumptions: Need to navigate from page 1 to page 2 and set P2_ITEM on page 2 to value of P1_ITEM on page 1.
Create button (let's say button name is MYBUTTON) of type "Submit Page"
Under "Processing", create a branch to page 2.
For "Page or URL" pick page 2 and set P2_ITEM to value P1_ITEM.
For "Process point" pick "After Submit"
Under "Server Side Condition", select "MYBUTTON" under "When Button Pressed".
Since this is a branch your page has been submitted and all the changes you made to P1_ITEM will be picked up. The fact that page 2 is modal does not affect this, APEX will take care of that for you.
As an alternative to Koen Lostries excellent explanation, in some cases it is also possible to have the target page load the item from the source page.
Ensure that the item is being pushed to the session, for example by using a dynamic action with the items to submit option, but do nothing else in this dynamic action.
Then, when page 2 opens, simply add a pre-header-process, that makes something like :P2_ITEM := :P1_ITEM;
In my experience this approach is easier than doing a redirect in a dynamic action, as there is no declarative option for that and you often need hand-written javascript to do that.

I cannot pass a value on button click in oracle apex 19.2

I have a wizard and i am trying to pass a value from one page to the next onclick a next button on the wizard in oracle apex but when i click next the value is not going through to the other side.
enter image description here
Image above shows the next button and the how i am trying to pass the value
thanks
What you did is this:
there's page 33
there are (at least) two items on that page
P33_ID
P33_NEW
you are passing P33_NEW item's value into P33_ID item
in other words, you're doing it on the same page, while it seems - according to what you said ("I am trying to pass a value from one page to the next") - that you're expecting something to happen on some other page
If that's so, transfer P33_NEW item value to "some other page", not page 33.
If you still want to do it on the same page, consider using a Set value dynamic action.

In Apex 5.1, how can I open an list item that links to a page in my application in a new window in my browser?

looking for a way in Apex 5.1 to open list items that goes to a specific page in a new window.
1 - Go to your list on Shared Components
2 - On each item of your list, fill on "User Defined Attributes" the second field (image below):
Example: https://apex.oracle.com/pls/apex/f?p=145797:5:
Test 1 open on another page
If dont work check the correct field to put your link attributes. (image below, click on it):

Link one page to another in oracle apex

this is supposed to be simple
i have two pages A and B what i want to do is add a button (a hyperlink or image will do) in page A that when clicked go to page B
how can i do that ?
thanks
If you don't want a button, simply use a html href to f?p=&APP_ID.:<your page number to link to>:&SESSION.
Go to page 2! takes you to your page number 2...
There are many ways. Perhaps the simplest is to create an Apex button using the Create Button wizard. Follow the instructions and when you get to the "Action When Clicked" page, choose "Redirect to Page in this Application" as the Action and enter the Page number you want to go to when the button is clicked. You can also enter other details such as Request, Clear Cache, Set These Items.

Resources