Pasar datos entre pantallas UI5


"routes": [
	{
		"pattern": "",
		"name": "worklist",
		"target": [
			"worklist"
		]
	},
	{
		"pattern": "Event/{objectId}",
		"name": "object",
		"target": [
			"object"
		]
	},
	{
		"pattern": "Addevent",
		"name": "addevent",
		"target": [
			"addevent"
		]
	},
	{
		"pattern": "Managedays",
		"name": "managedays",
		"target": [
			"managedays"
		]
	},
	{
		"pattern": "Managelanguages/{objectId}",
		"name": "managelanguages",
		"target": [
			"managelanguages"
		]
	}
],
"targets": {
	"worklist": {
		"viewName": "Worklist",
		"viewId": "worklist",
		"viewLevel": 1,
		"title": "{i18n>worklistViewTitle}"
	},
	"object": {
		"viewName": "Object",
		"viewId": "object",
		"viewLevel": 2,
		"title": "{i18n>objectViewTitle}"
	},
	"objectNotFound": {
		"viewName": "ObjectNotFound",
		"viewId": "objectNotFound"
	},
	"notFound": {
		"viewName": "NotFound",
		"viewId": "notFound"
	},
	"addevent": {
		"viewName": "Addevent",
		"viewId": "addevent",
		"viewLevel": 3
	},
	"managedays": {
		"viewName": "Managedays",
		"viewId": "managedays",
		"viewLevel": 3
	},
	"managelanguages": {
		"viewName": "Managelanguages",
		"viewId": "managelanguages",
		"viewLevel": 3
	}
}

Object.controller.js

nageLanguagesBtn : function() {
	
	var oView = this.getView();
	var oObject = oView.getBindingContext().getObject();
	
	console.log(oObject.id);
	
	this.getRouter().navTo("managelanguages", {
		objectId: oObject.id
	});
	
}

Object.view.xml

 

managelanguates.controller.js

onInit : function () {
	

	
	//Shows parameter received from before Controller
	this.getRouter().getRoute("managelanguages").attachPatternMatched(this._onObjectMatched, this);
	
	
	
	
},

_onObjectMatched : function (oEvent) {
	
	console.log("_onObjectMatched");
	var sObjectId =  oEvent.getParameter("arguments").objectId;
	
	console.log('Parametro recibido');
	console.log(sObjectId);
	
	
},


Tu opinión es importante para mi, ¿Te ha resultado útil este artículo?

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

*