The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, April 28, 2009

Avoiding Back button mishaps in ADF

In ADF, it is pretty difficult to handle browser back button press. This may lead to unwanted/ unexpected behavior. In simplest wordings the reason could be out of sync iterators when browser back button is pressed. There are no good solutions to avoid it but you can certainly prevent the side effects in a graceful manner. There can be two ways to do so:

1. Set the screen size so that back button is not visible at all.
2. Use enableTokenValidation in the application.

2nd solution deserves some attention and more details. Basically when you enable token validation for a page, that page is annonated with the current object for all the iterators used to render that page. This annonation is then submitted to the server along with any data. At that point the current object of the iterator is compared with the annotation. If they differs and exception is thrown. So, this way user can be prevented to see weired behavior.

To enable just go to page definition file and set the tokenValidation property to true.
Post a Comment