I have a question regarding routing in SAPUI5. I have a SplitApp container with two master views. The first master view displays a list of equipments. The second master view displays a list of measuringpoints of the chosen equipment. The data is (by now) located in a clientside JSON model wich looks like this:
{
"Equipments": [
{
"EquipmentNr": "Equipment 0000000001",
"Messpunkte": [
{
"MesspunktNr": "Messpunkt 01"
},
{
"MesspunktNr": "Messpunkt 02"
},
{
"MesspunktNr": "Messpunkt 03"
}
]
},
The detail page now should be able to access the "Messpunkt" chosen in the second masterview but I am not able to pass the parameters via routing. The routing configuration for routing to the detail view:
"routes": [...
{
"pattern": "master/{equiPath}/detail/{impttPath}",
"name": "detail",
"target": "detail"
}
],
"targets": {
...
"detail": {
"viewName": "DetailPage",
"controlAggregation": "detailPages",
"parent": "master"
}
}
I am not sure how to call the navTo method in the controller of masterpage2 because when i try to it always gives me an error saying "The segment {equiPath} is required."
when calling the onNavToDetail method in this form:
onNavToDetail : function(oEvent) {
var oItem = oEvent.getSource();
var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo("detail", {
equiPath: oItem.getBindingContext("equi").getPath().substr(0)
});
i get the whole path e.g. "/Equipments/0/Messpunkte/0" for segment "{equiPath}
the information in the documentation "working with nested components" don't really help me. Thanks for ever help. Best wishes