on 2016 May 17 5:40 PM
Now I'm using router with component.js and MyRouter.js file. However i have some problem.
First i click a page menu, it calls oninit() function correctly. but when i click a page menu at second times, onInit() function doesn't work.
How can i refresh page every time i click the page menu?
Request clarification before answering.
Hey John,
You could use attachMatched / attachPatternMatched event for this purpose. It is triggered every time when page is displayed. For example on your detail page you can attach a function to be called everytime like this:
onInit : function() {
this.getRouter().getRoute("detail").attachMatched(this.onRouteMatched, this);
},
onRouteMatched: function(oEvent){
// clear fields
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ugur,
Thanks but I m getting following error:
I am inside onRouteMatched()
Uncaught TypeError: I.fFunction.call is not a function
However it is successfully triggering method onRouteMatched() because it has returned the text which I wrote inside onRouteMatched() using console.log("I am inside onRouteMatched()").
User | Count |
---|---|
60 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.