- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
OnInit method is not getting called again when navigating back and forth from a view in SAPUI5
You have identified the correct use case as it is by design as you have navigated back and forth, it renders the last version rendered and OnInit() does not gets called. But if you want to override this behavior, SAP lets you do it.
You can delegate to the patternMatched event of router, so that wheever the view is rendered the OnInit() method is invoked.
this.getOwnerComponent().getRouter().getRoute("<Route name>").attachPatternMatched(<Your Handler>, this);
You need to attach the even handler to the router in the init method of the controller. Hope it helps and sorts out your requirement.
- Related Articles
- Getting data in SAPUI5 application from backend tables in NetWeaver
- Bouncing back of light from shining surfaces is called bending?
- How can saltwater reverse back to salt and water again?
- Page build in HTML and wanted to load into JS view in SAPUI5 application.
- Acne Scars: A Complete Guide to Getting Smooth Skin Again
- Passing to method geticon in SAPUI5
- Footer not working in my SAPUI5 application
- Calling a JAVA method through JavaScript in SAPUI5 project
- Getting error- is not an internal table “OCCURS n” specification is missing in SAP method
- Align items to center not working in SAPUI5
- Why is Greenland called as island and not a continent?
- How do you prevent a method from getting overridden in java?
- Why is Greenland called as an island and not a continent?
- When is copy constructor called in C++?
- Navigating your dashboard in Canva

Advertisements