on 08-21-2018 8:37 AM
Hi Experts,
My requirement: JsonModel/Model sharing between multiple BSP apps.
BSP 1 named as Parent App
BSP 2 named as Child App
I am able to call the model from child to parent app and vice versa by using eventbus.
I have a couple of doubts :
Thanks in advance.
Regards,
SG
You can pass any data to your child app within componentData, when you create your Component like this:
var oComponent = sap.ui.getCore().createComponent({
name: "your.namespace.ChildApp",
id: "ChildApp",
componentData: {
oJSONModel: oYourJSONModel
}
});
var oComponentContainer = this.getView().byId("idComponentContainer");
oComponentContainer.setComponent(oComponent);
In your child app component.js read oJSONModel like this:
var oComponentData = this.getComponentData();
var oJSONModel;
if(oComponentData && oComponentData.oJSONModel){
oJSONModel = oComponentData.oJSONModel;
} else {
// Fallback, if parent app passes no JSONModel
oJSONModel = new JSONModel();
}
Parent and child app are working on the same model now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
event is not meant for data passing, I think.
I don't know how you integrate two ui5 app, reuse component? there are different ways, you can use sap.ui.core to share data
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.