cancel
Showing results for 
Search instead for 
Did you mean: 

Sapui5 onAfterRendering is called twice then navigating to a page

I noticed that in a view controller onAfterRendering method is called twice then I navigate to a page from another one by this.getRouter().getTargets().display("home", dataObject);

But if I open the page using hash(#home) in url it's called as expected only once.

Is it the way It's supposed to be or I have some code in controller that couses it?

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Common mistake i do 🙂

1.While copying view i forget to remove controller in my View.xml
2.Use attachRouteMatched instead of attachRoutePatternMatched

Hope you would already have solved but might others in same situation