![](https://community.sap.com/html/assets/img_tile-default.png)
<OverflowToolbar id="tool">
<ToolbarSpacer/>
<Button press="onPressShare" icon="sap-icon://action"/>
</OverflowToolbar>
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:foot="sap.ushell.ui.footerbar">
<Popover showHeader="false" placement="Bottom" >
<VBox class="sapMPopoverCont">
<Button text="Send Email" press="onPress" iconFirst="true" icon="sap-icon://email"/>
<foot:AddBookmarkButton id="book" text="Save as Tile" title = "Maintenance Notification" showGroupSelection = "true"/>
</VBox>
</Popover>
</core:FragmentDefinition>
onPress: function(oEvent) {
sap.m.URLHelper.triggerEmail("", "Link to Maintenance Notification", window.location.href);
}
onSearch: function(oEvent) {
var oTable = that.oView.byId("smartTable");
var oFilt = that.oView.byId("smartFilterBar");
var mInnerAppData = {
selectionVariant: oFilt.getDataSuiteFormat(),
tableVariantId: oTable.getCurrentVariantId()
};
that.oNavigationHandler.storeInnerAppState(mInnerAppData);
}
Here we have selection variant which captures the filter which are set on screen and we save it in Inner App data.
On calling storeInnerAppState we will notice the URL will automatically change and a parameter will be added similar to this –
?sap-iapp-state=ASFLPLTWYA4IFMGQ1CG58TQG5SFZNXJYHI4QANW8
Note : We will have to define the navigation handler in the controller to use it.
"routes": [
{
"pattern": "",
"name": "notificationList",
"target": "notificationList"
},
{
"pattern": ":?sap-iapp-state:",
"name": "notifListQuery",
"target": "notificationList"
}
],
"targets": {
"notificationList": {
"viewPath": "XXXXX.view",
"viewName": "NotificationList",
"viewLevel": 1
}
}
If this is not done we will get an error because the first view has no pattern attached to it -
onInit: function() {
var controller = this;
this.oNavigationHandler = new NavigationHandler(this);
that = this;
var oView = this.getView();
var appStateKey = "";
var url = window.location.href;
var i = url.search('sap-iapp-state');
if (i > 0) {
i = i + 15;
appStateKey = url.substring(i);
}
if (appStateKey) {
var url1 = "/GlobalContainers('" + appStateKey + "')";
var oModel = this.getOwnerComponent().getModel('GlobalContainers');
var that1 = this;
var functionSucess = function(oData, controller) {
sap.ui.core.BusyIndicator.hide();
var oFilt = that1.getView().byId("smartFilterBar");
var obj = JSON.parse(oData.value);
oFilt.setDataSuiteFormat(JSON.stringify(obj.selectionVariant), true);
}
var functionError = function(oError) {
sap.ui.core.BusyIndicator.hide();
var test = oError;
}
sap.ui.core.BusyIndicator.show();
var params = {
success: function(oData, controller) {
functionSucess(oData, controller);
},
error: function(oError) {
functionError(oError);
}
};
oModel.read(url1, params);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 |