Modal dialog - refresh the parent page on close modal dialog or submit button - oracle

Using Apex 5.1.3
I have everyting working, but I have a requreimet to refresh the entire page (parent page) on the close of the modal page or press submit button.
I have tried quite a few things in dynamic actions on the parent page etc, but nothing is working.
How can I get the parent page to fully refresh when the modal dialog is submitted and closed.
Your help would be most appreciated.
Regards,
Morshed

You could either place a branch after processing on your modal that redirects to the parent page, or create a dynamic action 'on dialog close' on the button/region that invokes the dialog page, which then submits/refreshes the page.
If you think 'nothing is working', put APEX in debug mode, open your browser console, and check if the dynamic actions are actually firing.

Related

Oracle APEX - Refresh parent page 1 (interactive report) after closing a another page 2 (page mode = Modal dialog)

I am trying to refresh the interactive report on a parent page 1 after updating page 2 which is a modal dialog page mode. The page should close automatically after clicking the submit button (managed by a dynamic action). currently I have "apex.navigation.dialog.close(true);" as the last sequence of Dynamic true action on the modal page 2.
I also created a DA on the parent page to execute javascript code "$('#myirr').trigger('apexrefresh'); "
where #myirr is the static ID of the interactive report i want refreshed automatically. This did not work for me. Please can anyone give me some advice? Thank you for your assistance.

How to redirect to previous page after clicking "ok" on the apex.confirm message box in oracle apex dynamic action

How to navigate back to the previous page after I hit ok on the confirm message box on apex. I used a dynamic action on the delete button but it only deletes the record not navigate back to the previous page. Is my code below correct?
if(apex.confirm(htmldb_delete_message,'DELETE') == true)
{
apex.navigation.redirect(window.history.back());
}
If you are using the default delete button that is created by the form creation wizard, then on the button properties you'll see that the button's behavior target is defined by a javascript which prompts a confirmation window. After the user hits "OK" on that window, the page is submitted so your delete process can execute.
Trying to execute a javascript code before that to force the navigation may be a bad idea and you would have to restructure your delete process to be processed at the right point
Try to create a branch (https://docs.oracle.com/cd/E59726_01/doc.50/e39147/nav_branch_using.htm#HTMDB25149) instead of using a dynamic action to navigate back to previous page. You can configure it to occur "after processing" and either manually set the page that you to go back to or use a hidden item to always go back to the page which the user came from as described in here: How do add a button to go back to another page in oracle apex interactive grid

How to close modal dialog windows from javascript

I have a page from which modal dialog page gets opened. After page is opened, the user makes some selections and clicks on the button and some javascript gets executed. After it is done, I need to close the modal page. I tried window.close() but it did not work. How can I close the modal dialog page from javascript?
Try this:
apex.navigation.dialog.close(true)
https://docs.oracle.com/cd/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI30096
I have rarely seen the documentation on the method below. I had to read a book to find out.
Try this:
redirect to URL:
javascript:closeModal();
You can also pass the modal parameter if necessary:
javascript:closeModal('P2_HELP_MODAL');
You can also open the same way:
javascript:openModal('P2_HELP_MODAL');

Firefox does not the struts action again on click of browser back button

I load a page by calling a struts action. Now I go to some other link in the same tab from that page. If I click on browser back button the struts action is not being called again hence I am having some issue with the loading of the page. This behaviour does not exist in chrome as when I click on back button in chrome it calls the struts action again and load the page properly. Any idea how can I resolve this?

Wicket: Modal Windows and callback functionality

I have a modal window that shows a panel which contains a form that has some textfields and a submit button
on submit an insert into the database occurs and then I have some ajax behaviour that i want to activate on the modal windows containing page on click of the button.
So flow is at present:
click link
modal window appears
user fills out form
user submits form
form data persisted to db
modal window closes
I need it to do this in addition:
activate some ajax behaviour on the page that contains the panel
any help on how best to do this in the wicket way is appreciated.
I resolved this by passing an instance of the page containing the panel to the panel (i.e. - in the constructor), then calling a method on the page from the panel to perform the Ajax update.
I would be interested to see what others have done or to hear if there are issues with the approach I have taken.
Set up a WindowClose callback.
In the WicketStuff project called ModelX (Disclaimer: I'm the developer of that) I have created an IWindowClosedListener interface which has a method:
void windowClosed(Panel panel, AjaxRequestTarget target)
So then any Page or Panel that can open a modal that needs to do something when that modal is closed simply implements that interface and its windowClosed method gets called at the right time.

Resources