Regarding stopping page reload when button clicked - oracle-apex

I am working with Oracle Apex 4.2 where in i have a page which is Page1 and within the page i have a report region and a button. When i click on the button a Skill Builder Pop-up plugin hits up and a popup window opens up where in i created a form on another page which is Page2.
I am adding a JavaScript page refresh for Page1 and it will automatically refreshes the page at particular intervals. Code is as follows:
$(document).ready(function(){
setInterval(function(){cache_clear()},10000);
});
function cache_clear()
{
window.location.reload(true);
}
But when i click on the button, the page refresh on Page1 should stop and again it should get activated after closing the popup only.
Any help would be appreciated.

To stop process when button click use clearInterval() function.
Refer discussed thread Stop setInterval call in JavaScript
for more details.

Related

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

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.

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.

Make Carousel Container slider visible inside Inline Dialog modal

I have a Carousel Container slider, and it's visible and works fine as a region on the page. But for some reason it is collapsing and is not visible inside an Inline Dialog modal window region. Why and how to fix it?
EDIT 1: The only viable solution I've came to for now is to create a page as modal and call it on click of a button with a href.
The only working solution for APEX 5.1 is to create a page with Page Mode: Modal Dialog and call it from another page, for example, on click of a button with Redirect to Page behavior.

Execute custom javascript function on refresh button click in of Kendo upload control

I have been using the Kendo Upload control, in one of my project.
Once I hit the upload in, upload file popup, if there is any error the upload panel stay there. We display error message in another flyout which stays there for around 30 seconds.
When there is an error, there is no more upload button avaibale, in upload file popup, but we have refresh button.
What I want to do is, I want to execute a jquery function which can hide the error message.
How can I get access to refresh button event, as I do not see any event of refresh button in kendo upload.
We are using kendo mvc wrapper.
Hitting on refresh button should call your upload event.
What you can do is register for the upload event as below:
#(Html.Kendo().Upload().Name("uploadFile")
.Events(e =>
{
e.Upload("onUpload");
})
You can have then onUpload javascript function and hide your error flyout.
Note that above function will also get called on upload buttton click.

Django: Adding a confirmation dialog box after pressing the 'save' button in change_form

I would like to run a backend code after pressing the 'Save' button in the change_form (admin) screen, which will be followed by a confirmation dialog box which will ask something like 'nothing found, create new entity anyway?'
By pressing 'ok' in the dialog box the application will continue with the normal 'save' functionality. Pressing the 'cancel' button will throw us back to the change_form screen.
The workflow i'm trying to achieve is:
Press 'save' > run a python validation code > if code returns 'false' continue with the original 'save' functionality, else popup a dialog box > [dialog box] Ok > save the entity, cancel > stay on the change_form page.
Thanks for the help
Add a listener on the submit button with jQuery. Then fire off an Ajax request to the server to see if something has been found or not. Then display the dialog accordingly.
I was looking for something similar, to show a confirmation popup before updating some values and I found a library django-admin-confirm posting here for future explorers.