Hi
I was try mobile back button to logout the screen. I used this java script
Steps to follow:
1) Include the dialogs plugin as the Extensibility Configurations property value for the application module as shown below (Or define the dialogs plugin as an isolated application module)
{ "plugin": { "url": "https://github.com/apache/cordova-plugin-dialogs.git" }}
2) Under the Logic Tab, introduce OnApplicationReady Systems event
3) Within the OnApplicationReady action flow, introduce a JS node with the below script
JS Snippet:
function goToPreviousScreen(button) {
if (button == 1) {
history.back(); // go to previous screen, if presses "Yes"
} else {
return false; // No action, if presses "cancel"
}
function onBackButtonClick() {
document.addEventListener(
"backbutton",
function (e) {
navigator.notification.confirm(
"Are you sure you want to leave the screen?",
goToPreviousScreen,
"Warning",
"Yes, Cancel"
); // you can change the button names in the place of Yes, Cancel.
},
false
);
if ($actions.CheckDialogsPlugin()) {
onBackButtonClick();
but As I want to logout the page but this code used for previous page. have any solution for my problem. I was attach my OML file also
Hello @Palani Bharathi ,
You can use the Android back button forge component, which helps you handle back-button events on every page you can make a handler of block event and add your logic of what you want to do if the back button clicks on that particular screen.
Let me know if I am not able to understand the question.
Thanks
Regards Gourav Shrivastava
Hi @Palani Bharathi
I have attached Link so go through this link:
https://www.outsystems.com/forums/discussion/56573/exit-back-button-in-android/
Mansur
have any OML file for my reference?
I was go through the link and executed but not working
I have attached the OML file. please check it and let me know...
Hi, For mobile Back button issue refer this post it has a Solution.How to Exit App when Back button is pressed in mobile app | OutSystems