Skip to main content
Tuoman
Senior II
Mar 27, 2020 8:42 AM UTC
Solved

Transferring data between views after transition

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!

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Mar 31, 2020 2:25 PM UTC

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

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Mar 31, 2020 2:25 PM UTC

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