- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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.
- Getting data in SAPUI5 application from backend tables in NetWeaver
- Why is Greenland called as island and not a continent?
- When is copy constructor called in C++?
- Why is Greenland called as an island and not a continent?
- When are Constructors Called in C++?
- When is plt.Show() required to show a plot and when is it not?
- What happens when a function is called before its declaration in C?
- Footer not working in my SAPUI5 application
- Getting details when a table is modified in SAP HANA DB
- What happens when a virtual function is called inside a non-virtual function in C++
- How to call a static constructor or when static constructor is called in C#?
- Passing to method geticon in SAPUI5
- Page build in HTML and wanted to load into JS view in SAPUI5 application.
- Which herb is called a magical herb and why?
- Align items to center not working in SAPUI5