Skip to main content
Tuoman
Senior II
March 27, 2020
Solved

Transferring data between views after transition

  • March 27, 2020
  • 1 reply
  • 719 views

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.
Best answer by Martin KJELDSEN

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
March 31, 2020

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