Skip to Content

Reuse a view for different layout of the same application

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 16, 2014 at 09:15 AM

    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...

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.