Monday 2 August 2021

How to disable browser back button in OAF.


In First Page PR you have initialize a EO based VO for creating Row for the Transaction and  after you moved the Second page. Although your transaction is still in between and you use the Browser Back Button of the Second page to move the First Page.


One should use the Guidelines provided in the Developer's Guide for Disabling Browser Back Button Action.

Although all the Guidelines are scenario based and Correct but
By Using Java Script we can achieve this very quickly.

In this Browser Back Button Will remain visible but inactive.

Create a Rawtext Bean in your page and properties "text " put this code.

Code:

<html><head>
<script type="text/javascript">
window.history.forward();
function noBack(){window.history.forward();}
</script>
</head>
<body onload="noBack();" onpageshow="if(event.persisted)noBack();" onunload=""]
</body></html>