Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sap.ui.define([
- "sap/ui/core/UIComponent",
- "sap/ui/Device",
- "mdm/cmd/product/maintain/ext/ArticleHierarchy/model/models",
- "sap/suite/ui/generic/template/extensionAPI/ReuseComponentSupport",
- "sap/suite/ui/generic/template/extensionAPI/extensionAPI",
- "mdm/cmd/product/maintain/ext/ArticleHierarchy/util/ModelHelper"
- ], function(UIComponent, Device, models, ReuseComponentSupport, extensionAPI, ModelHelper) {
- "use strict";
- return UIComponent.extend("mdm.cmd.product.maintain.ext.ArticleHierarchy.Component", {
- metadata: {
- manifest: "json",
- properties: {
- draftKey: {
- type: "string",
- bindable: true,
- defaultValue: null
- },
- product: {
- type: "string",
- bindable: true,
- defaultValue: null
- },
- uiMode: {
- type: "string",
- group: "standard",
- defaultValue: "Display"
- }
- }
- },
- /**
- * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
- * @public
- * @override
- */
- init: function() {
- // call the base component's init function
- UIComponent.prototype.init.apply(this, arguments);
- // set the device model
- this.setModel(models.createDeviceModel(), "device");
- ReuseComponentSupport.mixInto(this);
- },
- createContent: function() {
- debugger;
- this.oView = sap.ui.view({
- viewName: "mdm.cmd.product.maintain.ext.ArticleHierarchy.view.ArticleHierarchy",
- type: sap.ui.core.mvc.ViewType.XML
- });
- // Transforms this component into a reuse component for smart templates.
- ReuseComponentSupport.mixInto(this, "component");
- return this.oView;
- },
- stStart: function(oModel, oBindingContext, oExtensionAPI) {
- debugger;
- var that = this;
- this._oModel = oModel;
- this._oBindingContext = oBindingContext;
- var oController = this.oView.getController();
- oController._extensionAPI = oExtensionAPI;
- var fnSuccess1 = function(oSuccess) {
- that.fnSuccess(oSuccess, oModel);
- };
- ModelHelper.readAHHeader(oModel, oBindingContext, fnSuccess1);
- },
- stRefresh: function(oModel, oBindingContext) {
- this.oView.byId("ArticleHierarchy").destroyItems();
- var that = this;
- var fnSuccess1 = function(oSuccess) {
- that.fnSuccess(oSuccess, oModel);
- };
- ModelHelper.readAHHeader(oModel, oBindingContext, fnSuccess1);
- }
- });
- });
Add Comment
Please, Sign In to add comment