APEX - double click on interactive gird - oracle-apex

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 :(

Related

How to give link for 3 different URLs on single button using select list in 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.

How to get value from a bar chart on oracle apex when clicking a specific bar?

I have a bar chart on an oracle-apex page, I want to get the value from a bar when I click on it.
How can this be done?
You can create a new Modal Page with one Item to receive the value.
On you Barchart page go to Series -> Link -> select Redirect Page in This aplication-> and choose the target.
In the Link Builder set Page field as your Modal Page Number and Set Items filed name = item in your modal page to receive the value

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.

How to set modal dialog title dynamically in oracle apex 18

I want to set modal dialog title dynamically based on an interactive element.
ex) In page 50, I've made an Interactive Grid and set the link on "Title" column, when user click on title column, a modal dialog appears.
I want to set the title of that modal dialog to title column's content.
But modal dialog's title doesn't change dynamically.
In this case, how can I apply the titles dynamically?
I've seen many solution related to this question, but I can't solve my problem.
Let's say, your model page number is 51. Here are step by step approach [TESTED] to dynamically change title of model page:
Create a hidden item in your model page, let's say the hidden item name is P51_Title.
In Interactive report -> title column link -> click on link builder box -> set values -> add Hidden item as P51_TITLE under Name and value as '#Title#' Column (#ColumnName#).
In model page 51 static region header (title property), add hidden item value as &P51_TITLE. (dot is mandatory to add at last. This is substitution string with & and dot(.) before and after of item name respectively)
save both the pages and run. when you will click on title column link, the link will be redirecting to the model page and title data will be passed through URL to hidden item in the session, so model page header will automatically change based on title data from report.
I made such dialogcreate js function.
It moves popup page Title to modal dialog title.
So, dynamic calculated title &P51_TITLE. would be applied automatically.
$(document).on("dialogcreate", ".ui-dialog--apex", function(e) {
var lDialog = $(this);
lDialog.find('iframe').on('load',function () {
lDialog.children(".ui-dialog-content")
.dialog("option", "title", $(this.contentDocument).find('title').html());
});
});
I am very disappointed that something like this (or any other solution) do not work in apex modal pages by default!

validation on button without refresh page on APEX5 5.0

Need your suggestions on handling the validation without submitting page in APEX 5.0. I have following items on my apex report page.
"Select list" item which contains some static values
date pickers ( start date and end date)
Submit button ( Once submit is clicked the report date is displayed )
Here I need to add a dynamic action or validation to the submit button so that if user clicks the submit button without selecting a value from the "Select List", an error message should be displayed to the user that he needs to select the item first from the "Select list" page item. With out any selection from the list , the processing should stop and a warning message should be displayed ( either it could be popup message or message can be marked on the select list page item ) .Point to be noted here that during the submit I do not want to refresh the page, just would like a quick error message to display.
Appreciate your help.
in a similar case i used dynamic actions
dynamic actions works on client side
in my case i am not enabling submit button until user changes the select list value
in my dynamic action my config is as below
Event=change
selection=items
item=selectlistID
and true action is
action=disable
button=submitbuttonname
in your case you can choose javascript as action and add your javascript code