How can I refresh and show/hide buttons in Buttons Container in Modal Dialog in Oracle APEX based on an Item Value? - oracle-apex

In Oracle APEX 22.1 (Oracle Database EE 21c) I have a Modal Dialog Box which has a button container with several buttons. These buttons are being shown or not, based on a item in dialog box variable that is 0 or 1.
When I press the button "UnDelete", a Dynamic Action of PL/SQL execution type is fired, change the value of a field in the database and then two another Refresh True Actions follow. The PL/SQL execution type changes the value of the field in the database of a table successfully and the first dynamic Action refreshes a Classic Report Region on the Modal Dialog Box showing the new correct value of the field.
The second Refresh True Action tries to Refresh the Button Container Region of the Modal Dialog Box in order to hide the button "UnDelete" and show the rest buttons, which all are Server Condition based on this variable value. The Refresh does not take place(maybe the Button Container Region does not support the Refresh Event or does not propagate it to its Buttons)?
How can I achieve this effect?
Thanks In Advance!
I tried the Refresh Action for the Button Container Region of the Modal Dialog Box,but the buttons are not shown/hide accordingly.

"Refresh" is not relevant for a button container. The "refresh" action in apex does an ajax call to refresh the content of a report - it just re-renders a part of the DOM containing data. Currently only the data rendered by a component can be refreshed using partial page refresh. A button can never "refreshed", it is rendered in the page rendering process and from then on it lives in the DOM for the lifespan of the page.
A server side condition is evaluated at page rendering time. If a server side condition yields false at page rendering time, the component is not included in the dom. So, they cannot be shown using a dynamic action afterwards (because they're not in the dom) and they cannot be re-evaluated using a dynamic action (because the dynamic action can only manipulate the dom and that condition was evaluated before the dom was rendered).
The solution to you problem is to use show/hide actions in a dynamic action for each of the individual buttons for the reasons explained above.

Related

Refresh only one region instead of the whole page in oracle apex

I have made a region containing 2 display only items and a button.
The button performs some dynamic action (execute pl/sql query) and the page is refreshed every time the button is pressed (submit page action) .
Is there any way that on click of the button only that particular region gets refreshed instead of the whole page?
Also for the display only items, lets say
item_label ==> item_display_value
how to add this (==>) symbol in between?
If the page is submitted, then it will refresh completely - that is how apex works. But if a submit is not needed, you can add an action of "refresh" to the dynamic action and remove the submit. Make sure the "Behaviour > Action" property of the button is set to "Defined by dynamic action".
Note that not all region types support refresh, but all report types do.

Refresh browser after modal dialog

My application calls a modal window from the navigation bar. The modal window has a pop-up LOV where the user selects an organization they wish to view data for. As soon as the change event occurs, the page is submitted, recording the new organization id and organization name into session state. The modal dialog is then closed.
The navigation bar displays the name of the organization that is stored in session state, making it simple for the user to tell which organization they are working with.
Since the modal to change organizations can be accessed from any page in the application, I need to be able to refresh the web browser to pick up the new organization name displayed in the nav bar once the modal has closed.
I've seen several posts online as to how to refresh a region or report once a modal closes, but I've not uncovered how to refresh the browser window, or perhaps alternatively, how to redirect back to the page where the user was when they accessed the modal via the nav bar.
How can this be achieved?
(Nav Bar displaying current context, and link to modal window)
#TineO - I was orginally thinking the same as you suggested, but the implementation wasn't coming together for me.
After further internet mining, I found this blog post which led me to a working solution, below. The bind variable :REFERRING_PAGE is a hidden field, which is populated by the link in the nav bar, using the configuration in the second image below.
You can create dynamic action or process which can work on 'click' action. You may just run 'submit page' or pl/sql or from a huge list of activities as per your need.
Hope this helps.

Retool: Action button to open modal with container

I have a table in retool. I've added an "action" column with buttons and renamed them "edit". What I would like to do on click of the action button is to open a modal with the data in the row populated. A user should be able to see the values of the row, edit them and when he clicks "submit" it will send an update API call for that row's unique id.
We’re working on some new docs for modal components, but until then here’s what you can do:
Drag a modal component onto your canvas. It’s going to appear as a button that opens a model, but don’t worry about that just yet
Create a Javascript query in the query editor that opens the modal. If we’re working with the default names, your query would be modal1.open()
Configure the action button in your table to run that JS query on click
That’s a quick way to open a modal through an action button. In terms of what’s in that modal, you can drag any components you want and reference table properties. So if you wanted to display a user’s email, you could drag a text component into the model and set its value to table1.selectedRow.data.email.
The last thing to deal with is the button, which you probably don’t want since you’re opening the modal via action buttons. You can hide it by clicking on it, heading to the inspector in the right sidebar, and scrolling down to the “display” settings. Just put true into the “Hide when true” field and the button won’t show.
hello stack overflow family this is my first post.
we are facing same issue today so i used one trick for opening a modal in action, i run one query that query name is model_open and in success event i select modal open and this query is triggered in Action edit option ,
i hope my first post help you ... :)

ORACLE APEX MULTIPLE DYNAMIC ACTIONS ON SINGLE BUTTON IN UNIVERSAL THEME

I have executed an pl/sql query on my "run report button". It works fine. After the execution of the query I want it to be redirected to other page.The page to which it should be directed must be a modal page. How can I achieve this in Oracle Apex 5.1.
Create a branch with Type - Page or URL after processing with the "run report button" as server side condition and specify the modal page as target page.
UPDATE
You could follow the methods described here and in here.
But here's another hack that's relatively simpler to implement over those 2 approaches.
Create a 'REDIRECT_TO_MODAL' button and set the server side condition to 'Never'
Create a After processing branch with Type - Page or URL target and specify the modal page as target and select 'REDIRECT_TO_MODAL' as the button in server side condition.
To the already defined dynamic action, add another true action after the execution of PL/SQL process and make it 'Execute Javascript' with the following code:
-apex.submit({ request:"REDIRECT_TO_MODAL",showWait:false});
Also, make sure on the modal page, both Page Mode and Dialog Template are set to Modal Dialog.

Refresh function in Oracle - APEX 5.1

I'm using Oracle APEX to create a food ordering application. The application allows the user to add an item to their order through a popup window in which the user can select the quantity of the ordered item.
My problem is that after the user adds the item to the order from the popup window the popup window is only closed and the main page is not refreshed. I have a PL/SQL region on the main page that prints the items chosen along with their prices and quantity so that region needs to be automatically refreshed after the popup is closed. How can I implement that?
When saying a "popup window", is that a modal page? If so, how about a dynamic action on "Dialog closed"; a TRUE action would then be "Refresh".
Create a dynamic action on the parent page on dialogue close of the modal page which refreshes the region.