Skip to Content
1
Former Member
Jan 29, 2016 at 09:15 AM

Multi Component in SAPUI5

457 Views

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