on 01-29-2016 9:15 AM
Dear All,
I am sure that SAPUI5 supports multi Component in SAPUI5. But I am not able to demonstrate practically.
What I have done is:
1) Created a SAPUI5 Application with a Component code as :
jQuery.sap.declare("test.Component");
sap.ui.core.UIComponent.extend("test.Component",{
createContent : function(){
// this.oButton = new sap.m.Button()
return new sap.m.Button({text:"login"})
},
myButton : function(){
return new sap.m.Button({text:"login"});
}
})
It works fine as individual Application, now I have created another SAPUI5 Application and created a component code as:-
jQuery.sap.declare("test2.Component");
jQuery.sap.registerModulePath("test", "")
jQuery.sap.require("test.Component");
sap.ui.core.UIComponent.extend("test2.Component",{
createContent : function(){
return test.Component.myButton();
},
})
I am blur at what to define at line no 2 : jQuery.sap.registerModulePath("test", "<what to define here>");
both applications are deployed to the same server.
Please advice.
Regards,
Devender
Achieved.
We need to create an instance of Component where we are calling (inside calling component)
var ocomp1 = sap.ui.getCore().createComponent({
name : "test", // name of the component from it's declaration part
url : "/sap/bc/ui5_ui5/sap/z_comp1" // path if the BSP Application
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Devender,
Did you try to access this in eclipse instead of testing and pointing to bsp application in your server.
Because i am unable to access component of application 2 in application 1.
I have a application called "dealapp" and component name is sap.deal and maintained resource roots as "sap.deal": "../../dealapp", in index.html of application 1. I checked in network tab of application 1, it is calling to http://localhost:51169/dealapp/Component.js with 404 error.
Can you help me!!!
Thanks,
Ramesh
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.