Hello together,
I have some strange error when creating an item with odata and navigation - maybe anyone can help me.
I have two views.
1. Worklist.view.xml --> Display items
2. Object.view.xml --> Display Details of an item
On the Worklist.view.xml I create an item an navigate to the Object.view.xml
oDataModel.create("/LOPSet", { IdKunnr: lvIdKunnr }, { method: "POST", success: function(data) { var sNewId = data.Id; that.getRouter().navTo("object", { objectId : sNewId }, true); }, error: function(response) {MessageToast.show("Fehler");} });
The navigation to the object list works fine. But if I want to navigate back the worklist view I will get an error.
The Coding for navigating back is:
onPressCancel: function (oEvent) { var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("worklist"); },
The error is:
Does anybody have an idea what I have to do?
The strange is. When I do the following - it works fine:
- first select an item (in edit mode)
- navigate back to the worklist
- create a new item
- navigate back to worklist => at this time it works fine
Best regards
Uwe