First route in base Component is overwritten when extending its routes
See original GitHub issueOpenUI5 version: 1.36.9-
Browser/version (+device/version):
- Chrome 50.0.2661.102 m for Windows
- Microsoft Edge 25.10586.0.0
- Probably affecting others as well
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): https://github.com/fabiopagoti/ui5-extend-navigation/commit/947ed7b9c5bab483218bba357d04cd1891d7450d
User/password (if required and possible - do not post any confidential information here):
As this issue is related with Component extensions, there are two components
base.app -> inside folder “Base” ext.app -> inside folder “ExtensionDifferentDefaultRoute”
Inside the base Component, there are three views and the navigation between them work as follows
A* <—> B <—> C
- = default route (pattern: “” in the route object)
Inside the extension Component, the objective is to have the same views and the same navigation, just changing the default route to make B as the default view
A <—> B* <—> C
Steps to reproduce the problem: 0. Open app inside folder Base and navigate between all views
- Open app inside folder ExtensionDifferentDefaultRoute -
- Click in the “Go to C” button (it navigates normally to page C)
- Click in the “Go to B” button (it navigates normally to page B)
- Click in the “Go to A” button (it displays an error in the console - Can not navigate to route with name r1 because the route does not exist)
What is the expected result? It should navigate to page A
What happens instead? Navigation is not triggered
Any other information? (attach screenshot if possible)
Inside method onPressButtonA of controller Second, inspect available routes using the following commands
var router = this.getOwnerComponent().getRouter() router._oRoutes
You will see that route r1 is not available.
Now, open Component.js from the Base folder and remove the comment in line
routes: [
// {}, // uncomment this to make r1 available in the extension component
{
pattern: "",
name: "r1",
target: "t1"
},
There will be a empty and first route in the base component.
After that, repeat the steps and you will see that the error is not displayed in the console anymore, but the navigation to page A is still not triggered.
This proves that the “First route in base Component is overwritten when extending its routes”.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Hello Fabio,
thanks for the very detailed description of the problem and also providing a git repository to reproduce the issue. I will have to ask our component expert to take a look as this will need some deeper analysis from our side.
Stay tuned, we will get back to you soon here.
Internally tracked as: #1670331623
Kind Regards, Michael
Hi Fabio,
ok - I will close this ticket. But I will consider to enhance the documentation as you suggested.
Best regards, Peter