cancel
Showing results for 
Search instead for 
Did you mean: 

Call another SAP UI5 controller in new SAP UI5 Project,

Radhey
Explorer
0 Kudos

Hi Expert

I have a scenario, I have project test1, totally working fine. Having 3 views like view1,view2,view3

I created a new project test2.

Now I want to use test1- view1.js controller in project test2,

I do not want to reuse the sapui5 total project,

I don't want to load any view from the project test1.

I don't want to add any js library to my project.

Directly want to access view1 controller from project test1.

Also, the main thing, test1 project-view1 holds the model, it's getting data from the backend. All processes in the test1-view1 controller and it should return me final data.

is it possible? if yes then how.

Radhey
Explorer
0 Kudos

this is a client requirement. I said not possible, it's not the right MVC approach.

Project test1 running on Menifest, the root view is there. not possible to call the method from view from project test1.

Another option, create a library project or create a separate JS file, attach it to the script in HTML, and reuse the method.

if any one has solution welcome..

Accepted Solutions (1)

Accepted Solutions (1)

Radhey
Explorer

hi

created ui5 library project and re-using its all method in multiple application.

Answers (1)

Answers (1)

arunmbarec
Participant
0 Kudos

Hi Radhesh,

Take a look at the component usage concept.

https://www.youtube.com/watch?v=V6xOig4H-aA&t=838s&ab_channel=UI5

Regards,
Arun K

Radhey
Explorer
0 Kudos

hi arun,

I saw the video, and the first thing it mentions is the load UI component. I don't want to load any view from component 2.

i want to direct access method from component2 view1 controller method, i dont think so this is possible?