How to give link for 3 different URLs on single button using select list in oracle apex - oracle-apex

If user selects one option from select list then that button should link to different URL, if user selects second option from that select list then that same button should land at another URL , Kindly help me in it using ORACLE APEX.

Create a page item P1_URL of type select list
Add a couple of entries - for this example I'm using static values but a query should work too. Make sure the return value of the entry contains the actual url:
Create a button with action "Submit Page"
Create a branch
Execution Options > Point > "Processing"
Type: "Url defined by Item (Redirect)"
Item: P1_URL
Run the page, when you click the button the page should redirect to the selected url.

Related

APEX - double click on interactive gird

Below is my interactive grid. It shows data from v$sql_monitor view based on sql_id from list .
What I would like to do is to create double-click dynamic action on a record. This action would open new modal dialog and pass two parameters : 1. sql_id from list above 2.sql_exec_id from clicked record. Would you give me a few hints how to do it ? I guess a piece of Javascript code will be necessary :(
There are multiple options to do this - here is one way, by using javascript custom events. I created a sample with an IG on the EMP/DEPT sample dataset with page 88 as IG and page 90 as modal. The column ENAME is a link to page 90 that sets a column value and a page item in the link.
Page 88 has an IG and 2 page items:
P88_PAGE_ITEM (a value entered on the page like the list in your screenshot)
P88_ENAME (to hold the selected report column value
Page 90 has 2 page items: P90_PAGE_ITEM and P90_REPORT_COLUMN
Create IG on page 90 on table EMP
On column ENAME, add the following under "JavaScript Initialization Code"
function(config) {
config.defaultGridColumnOptions = {
cellTemplate: '<button type="button" class="t-Button t-Button--link my-ename-js" data-ename="&ENAME.">&ENAME.</button>'
};
return config;
}
This is a button of type "display as link", created with the universal theme button builder that has 2 extra attributes: a class my-ename-js and a data attribute "ename" data-ename="&ENAME."
Create a dynamic action to capture the click and set the page item:
Make sure to set the scope to "Dynamic". This is needed because the event listener needs to be added again after a dom change (a search or filter of the IG).
add a true action of type "Set Value" to set the value of P88_ENAME to the value of the selected row
add a second true action to trigger a custom javascript event:
Create a dynamic action of type "Event: Custom" to capture the custom event triggered in the previous DA.
add a true action of type "Submit Page". Note that "Show Processing" needs to be unchecked.
Almost there. One last thing is to create a branch to the modal page:
Create a branch (process point "After Processing") with server-side condition of "Request = Value" with value OPENMODAL and link attributes below:
And this should be the result:
Well, I modified a bit your scenario.
I added new SelectList P88_FILTER
and added dynamic action ON_CHANGE :
with action
I modified source if IG:
These changes allowes me to filter IG . In our case filter returns always only one record like below.
and now my problem begins. In your scenario clicking the link "ename" updates field P88_ENAME and opens modal dialog with proper values. After my modification neither P88_ENAME updates nor modal dialog opens :(

Pass an URL parameter to public page and query by it (Oracle Apex)

I need to call public apex page (without authentication) and pass parameter to it through the URL
and make the page to query a table with that parameter when page load
for example pass employee id through URL and the page display the employee data
if you have an example of dummy page it will be great
I am using Oracle Application Express 20.1.0.00.13
Example for the emp table of one way to do this. I'm doing it with a report but you should be able to figure out based on this how do do it with a form too.
Create a page of type "Report > Interactive Report". Select table "EMP" and create the page.
Edit the page in page builder. In my case this the page nr is 15.
Create page item P15_ENAME of type "Hidden"
Modify the report region: set WHERE clause to ENAME = :P15_ENAME
Modify the page properties: set authentication to "Page is public". Save.
Run the page with the url like this <hostname_and_path>/f?p=<your_app_id>:15:::::P15_ENAME:KING (replace the values between <> with your own).

ORACLE APEX: Getting the value from page item and use it to another page item

I have two forms:
first one:
5000_Works,
with items:
P5000_ID,
P5000_Working_Date,
P5000_QTY
and the second form:
5001_Tasks,
with items:
P5001_ID,
P5001_QTY
I open the second form from the first one and i want to put the value of P5000_QTY to the second page item P5001_QTY.
How can i do that?
Thank you
One option is to create a button which - when pushed - redirects to another page in this application. When you click on the "Target" (in "Behavior" properties section), you can tell Apex to:
navigate to page 5001
set item P5001_QTY to value &P5000_QTY. Note leading ampersand & and trailing dot .
And that's it ...
If it isn't a button but a branch, the principle is the same - using the Link Builder you'd do exactly the same.

Redirect from bootstrap tab to another Django

I have two tabs in a template.In one tab I can create attendance(tab1) in another tab I can view attendance(tab2) that was created previously.Now when I create a attendance successfully I want to check if the attendance is valid and if valid I want to redirect from tab 1 to tab 2. How can I achieve this in Django?
Here's my template and view snippet
https://gist.github.com/quantum2020/c55adeb3b8c2ee0ac2d99ff46f5699e8
https://gist.github.com/quantum2020/2cb28233608c3a219ff97762e1fd62be

how to redirect another page with select list value on button click in oracle apex?

i have select list values.after any change in select list and click on Button (it have to redirect the page number i have mentioned with select list value changed).
what i have done so far.
take another item P213_CLASS_TYPE_VAL
create DA on select list
Select :P213_CLASS_TYPE into :P213_CLASS_TYPE_VAL from dual;
item to submit : P213_CLASS_TYPE,P213_CLASS_TYPE_VAL
item to return : P213_CLASS_TYPE_VAL;
Button Action: Redirect to Page in this Application
Page 218
Set Item
Name Value
P218_GET_CLASS_TYPE &P213_CLASS_TYPE_VAL.
the issue we face is, some it redirect with changed item value and some time redirect with previous item value
You don't need a dynamic action to redirect to another page, that is a common mistake and unnecessarily complicates things.
The easiest way to do this is to have the button submit the page and create a branch to page 218 where you pass the value of P213_CLASS_TYPE_VAL.
On page 213: Button with action: "Submit Page"
On page 213:
Branch to page 218 with:
Server-side condition: "When Button Pressed" = your button.
Behavior: Page or URL(Redirect), page 281 and Set Items P218_GET_CLASS_TYPE to &P213_CLASS_TYPE_VAL.
That's all there is to it.