11
Views
2
Comments
Solved
Creating a New Object - "Back" in Browser - Old Data Blinks
Question
Application Type
Reactive

I am doing the "Web Developer" guided path. Here is a very simple situation: https://learn.outsystems.com/training/journeys/web-developer-662/using-server-action-exercise/o11/6234 see the sentence "Notice that after saving the inputted data, the form automatically resets to its initial blank state." The users clicks on "Add Employee". Fills in Name, Phone numer etc. Clicks Save. The form is blank now (because in the Screen Action, we added Destination - Current Screen with NullIdentifier() for EmployeeId). So far, so good, it works. But every software dev should check what happens if the user clicks Back in the browser, if they do not break our app. Well, after clicking back, the data the user filled in before appear again - for a short time (like half a second) - and after that disappear and the form is again blank. Not very nice. How can we prevent the blinking of the old data? We just want to see the blank form right away after clicking on back.

EDIT: I tried adding "Assign" node before "Destination" node that opens the detail screen. In "Assign", I assigned NullIdentifier() to EmployeeId but that did not help. I am not sure what does the app when clicking on Back in the browser.

2019-01-31 08-54-57
André Costa
Champion
Solution

Hey @Lukas Tomek 

Every browser has its own behavior when handling the back button, and in OutSystems, there isn't a native event to trigger and handle its logic when the back button is clicked.

However, you can implement custom JavaScript to intercept the back button click and execute specific logic.

https://stackoverflow.com/questions/25806608/how-to-detect-browser-back-button-event-cross-browser

This can help you too:

https://www.outsystems.com/forums/discussion/8206/how-to-disable-back-button/#Post58684

AC


UserImage.jpg
Lukas Tomek

OK, thank you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.