Quantcast
Channel: SCN: Message List - SAP Fiori
Viewing all articles
Browse latest Browse all 2526

Re: Extending SAPUI5 Applications - Purchase Orders

$
0
0

problem solved.

 

Problem: Create new view, attachRouteMatched error method.

 

 

step solution:

 

The method getRouter was generated to bring the global Router.

 

 

step code.

 

component.js image attach

 

newview.js  - sap.ui.controller sap.ca.scfld.md.controller.BaseDetailController.extend do not use the library, not to'd use case

 

sap.ui.controller("nw.epm.refapps.ext.po.apv.po.tgv.com.controller.vista1", {

 

 

  onInit: function() {

  this.getRouter().attachRouteMatched(this.onRouteMatched, this);

  },

  getRouter: function() {

  return sap.ui.core.UIComponent.getRouterFor(this);

  },

  onRouteMatched: function(oEvent) {

 

 

  var sName = oEvent.getParameter("name");

 

 

  if (sName !== "PurchaseOrderDetails") {

  return;

  }

  var oView = this.getView();

  var sPOId = decodeURIComponent(oEvent.getParameter("arguments").POId);

  oView.bindElement("/PurchaseOrders('" + sPOId + "')");

 

 

  sap.m.MessageToast.show("ejemplo");

  },

 

 

  onVolver: function() {

  window.history.go(-1);

  }

});

 

exthook S3_PurchaseOrderDetailsCustom.controller.js

sap.ui.controller("nw.epm.refapps.ext.po.apv.po.tgv.com.controller.S3_PurchaseOrderDetailsCustom", {

 

 

  extHookOnDataReceived: function(oPurchaseOrder) {

  // Place your hook implementation code here

 

//reload the new fields Odata service

  this._oPurchaseOrder = oPurchaseOrder;

  var oView = this.getView();

  oView.bindElement("/PurchaseOrders('" + this._oPurchaseOrder.POId + "')");

 

 

  },

  getRouter: function() {

  return sap.ui.core.UIComponent.getRouterFor(this);

  },

  nuevavista: function(oEvent) {

  this.getRouter().navTo("vista", {

  "POId": this._oPurchaseOrder.POId

  });

  }

 

 

});


Viewing all articles
Browse latest Browse all 2526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>