Question

In a shell, I would like to switch current workset item to another one (in the same shell), as result of pressing a button in the first workset item. I tried this:

press: function(oEvent) {
  var mainShellRef = sap.ui.getCore().getElementById("mainShell");
  var datasetRef = sap.ui.getCore().getElementById("dataSetId");
  mainShellRef.setContent(datasetRef);
}

where dataSetId is the workset item in which I would like to go after pressing this button. The problem anyway is that the workset actually changes, but the header remains the same of the previous one.

I get the same result if I use mainShellRef.fireWorksetItemSelected({...}).

Is there a better way to perform this action?

Thanks!

Was it helpful?

Solution

It seems that setContent only is not enought, so this solves the problem:

press: function(oEvent) {
  var mainShellRef = sap.ui.getCore().getElementById("mainShell");
  var datasetRef = sap.ui.getCore().getElementById("dataSetId");
  mainShellRef.setSelectedWorksetItem("navStoreSubList");
  mainShellRef.setContent(datasetRef);
}

where navStoreSubList is the id of the workset item (NavigationItem control) in which I want to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top