<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
<QuickView
id="quickView">
<QuickViewPage
icon="sap-icon://building"
title="{CompanyName}"
description="Contact: {ContactName}">
<QuickViewGroup heading="Location Details" >
<QuickViewGroupElement
label="Address"
value="{Address} {City} {Region} {PostalCode} {Country}"/>
</QuickViewGroup>
<QuickViewGroup heading="Contact Details" >
<QuickViewGroupElement
label="Phone"
value="{Phone}"
type="mobile"/>
<QuickViewGroupElement
label="Fax"
value="{Fax}"/>
</QuickViewGroup>
</QuickViewPage>
</QuickView>
</core:FragmentDefinition>
<ObjectAttribute title="{i18n>priceTitle}"
text="{CustomerID}"
active="true"
press="onCustDetails" />
sap.ui.define([
"./BaseController",
"sap/ui/model/json/JSONModel",
"../model/formatter",
"sap/m/library",
"sap/ui/core/Fragment"
], function (BaseController, JSONModel, formatter, mobileLibrary, Fragment) {
onCustDetails: function (oEvent) {
var oModel = this.getView().getModel();
this.openQuickView(oEvent, oModel);
},
openQuickView: function (oEvent, oModel) {
var oCustID = oEvent.getSource(),
oView = this.getView(),
oContext = oView.getBindingContext();
//Load fragment and add as dependent of this(Detail) view
if (!this._pQuickView) {
this._pQuickView = Fragment.load({
id: oView.getId(),
name: "ns.HTML5Module.QuickView.QuickView",
controller: this
}).then(function (oQuickView) {
oView.addDependent(oQuickView);
return oQuickView;
});
}
this._pQuickView.then(function (oQuickView){
//Set path to Customer
var sPath = `${oContext.getPath()}/Customer`;
//Bind path and model to Quickview
oQuickView.bindElement({ path: sPath, model: oModel.name });
//Set CustID field as the source so that popup launches it
oQuickView.openBy(oCustID);
});
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
10 | |
8 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 |