cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass an object while routing to new view in ui5

Hello Experts,

In my application, I am opening a new page in a new tab when the user clicked on a button. This new page displays the data which it received from the previous page. I am able to retain the object data by setting the JSON model to the UI core or view if I use navTo() and don't load the view in a new tab. But, when I try to open the view in a new tab the model is getting destroyed. I have searched in the community and google but I could not find the solution.

Please, let me know if this can be achieved in UI5 and how.

Thanks in advance.

Venkatesh.

Accepted Solutions (0)

Answers (1)

Answers (1)

FlorianVogt
Advisor
Advisor
0 Kudos

Hi Venkatesh,
there are multiple options to achieve your scenario. Let me summarise two (three) of them. Option 1 and 2 can also be combined.

Option 1: Add the needed data to the route URL (route pattern and the pass the data to the navTo call)

Option 2: Add a surrounding view which contains the existing views. Set the model to this outer view, so the data is available in both.

(Option 3 - not recommended): Set the model to the core. Which is highly not recommended.

I would also recommend the UI5 routing essentials https://ui5.sap.com/#/topic/3d18f20bd2294228acb6910d8e8a5fb5 to you