cancel
Showing results for 
Search instead for 
Did you mean: 

Reuse a view for different layout of the same application

Former Member
0 Kudos

Hi experts,

I'm currently trying to reuse a view that I created in order to have different layout of my app without having to code everything again...

Let me explain the situation.

I currently created an app displaying some input in different views, each view leading to the next one, like a step by step.

Example:

  1. In the first view, the user will select en employee then press next
  2. In the second view, the user will select an address for this employee then press on next
  3. In the third view, a form is display to fill in a letter to be sent to the selected employee address

I would like to have those 3 steps in a single screen when it's executed on a desktop in a form of a grid with the 2 first step on the left (under each other as rows) and the letter on the right.

Is it possible to call those existing views and display them in the single screen? Obviously some code change for the events will be necessary in the single window version but that's ok. What I would like to know is:

  • Is it possible?
    • if yes, how to call the views?
    • if not. how would you do it?

I tried calling the view in the controller of the single screen as follow:

   


var oView = sap.ui.jsview("view.employeeSelection");

this.getView().oPage.addContent(oView);

The view is correctly instantiated as I can reach my breakpoint in the "init" method of my employeeSelection view but I never reach the part generating the display... And nothing is displayed...

Your help and/or advices will be highly appreciated

Thanks a lot,

Jon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Note that the "createContent" of the view I try to insert in the main view is called correctly but it seems that the "onBeforeShow" function is never reached...

Former Member
0 Kudos

I managed to have this working by replacing the "subviews" by controls

I guess my previous implementation was not correct...

Answers (0)