cancel
Showing results for 
Search instead for 
Did you mean: 

Transferring data between views after transition

Tuoman
Senior II

What is the intended way to transfer data between views? Global variables in FrontendApplication or something else?

For example I have views that can be entered from multiple locations, and the view should go back to the specific view that it originated from.

I also need to transfer strings from views to others, and more.

How is this supposed to be done?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @Tuoman​,

Since only one view can be active at a time, use the presenter of the view to save data in the model and load that data when the presenter for the NEW view activates.

save data: view1 tell presenter1 to save data to model (presenter has model pointer)

load data: presenter2 activate() loads from model and sets data in view2

/Martin

View solution in original post

1 REPLY 1
Martin KJELDSEN
Chief III

Hi @Tuoman​,

Since only one view can be active at a time, use the presenter of the view to save data in the model and load that data when the presenter for the NEW view activates.

save data: view1 tell presenter1 to save data to model (presenter has model pointer)

load data: presenter2 activate() loads from model and sets data in view2

/Martin