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

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

Related

How do I stop my application express after submit process firing on page refresh?

I have an oracle application express process, written in PL/SQL and it fires off a confirmation email, supposedly when you click on the related button, (It is an after submit attached to the button) however, it is firing every time you refresh the page. Is there a different way of doing this so it only fires when you click the save changes button?
Take note of the execution point attribute. It will won't apply to page refreshes if it's either 'Processing' or 'After Submit'.
You can also associate these after-submit processes with specific buttons, using the 'when button pressed' property.
You may also wish to consider the 'Enable duplicate page submissions' page property.
If you're still having issues, you can build a demo at apex.oracle.com, and updated your question.

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

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.

NSIS - InstallOptions - Skip validation on back button

I am developing an NSIS package for one the products. I have a custom page for gathering SQL Server login credentials. On this page, clicking next must validate the given inputs (whether it connects to the server with given credentials). This works fine.
Problem:
If I press back button on this page, it is still validating the input; which I do not want. I could not find any way out to skip the validation on clicking back button.
Any suggestions in this regard is appreciated.
Found the answer!
We can specify two function names while calling the page custom command. One to show the page and one for validating which is called as leave page.
Page custom ShowDatabasePage LeaveDatabasePage
In the leave function, we can do all the validation. If the validation fails just call abort and the work is done. Leave function is called only when the next button is clicked.

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.

AJAX webpage to navigate on previous page

The data is displayed in gridview with paging on an AJAX enabled webpage. The gridView contains Item templates containing a link button. On itemCommand event, page redirects to display data in new page. When the Back button on browser is pressed, the previous state of the page doesn't load.
Perhaps set a cookie and use it to get the right page when initializing the gridview. Or modify the hash at the end of the URL (eg, add "#page2" to the location bar and read it back on init).
Look at this js stuff from google
Use Google Web Toolkit, it allows the state to be bookmarked and isn't affected by back/forward button.
Otherwise your options are:
Telling the user to not press the back button.
Putting the state in the url, e.g mypage.asp#page_123 and using that to determine the state in your javascript at page load.

Resources