cancel
Showing results for 
Search instead for 
Did you mean: 

Passing the data from one XML View to another XML View with out Router in SAP UI5

P561888
Active Contributor
0 Kudos

Hello Experts,

I have created the Main and Second XML views and I would like to send the from Main to Second with Element Binding with itemPress Event. When click on the Record, it is going to Second view and values are not available.

I am using the JSON Model with 10 records and I see all the records available in the Main View.

It would be great if you shower some information what mistake I am doing..

Thanks and Regards,

Bharani

Accepted Solutions (0)

Answers (2)

Answers (2)

thalesvb
Active Contributor
0 Kudos

Hello, you have a range of options to do that:

  • Use Event Bus (I read really quick the blog that I referred, but this works across controllers from different pages, even with controllers from different apps when doing Component Usage).
  • Use a component model (defined in manifest.json); but you have to remember to clean after consumption or handle dirty data to avoid displaying wrong values.
  • You didn't showed your code, but if you are navigating with something that inherit NavContainer you can directly pass data on to method (your data is available on beforeShow event of target page).

You can even be hardcore and transfer them using HTML5 Session Storage.

Next time provide a snippet of your code that isn't working (in this case how you are doing havigation, and how you are trying to get data on target page) because your current code could be on right path and just needed a small tip.

Best regards

former_member540067
Active Participant
0 Kudos

Set the model to core using sap.ui.getCore().setModel() and access it in the other view.

junwu
Active Contributor
0 Kudos

saving to core is usually a bad idea.....

former_member540067
Active Participant
0 Kudos

Why? Is there any documentation which States so?