Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Author Topic: Pass data from one View to another  (Read 4039 times)
Jr. Member
Posts: 15

View Profile Email
« on: March 12, 2010, 05:44:46 »

Hello, forum!

There is a main display View with a ViewStack where ListView and DetailView is put. When user hits the item in ListView, ListViewMediator generates a notification that is handled by MainDisplayMediator and it changes the selectedIndex in the ViewStack. The question is how to pass a parameter from ListView (selectedItem) to the DetailViewMediator? What is the best way to do that?

I guess, I need to pass the selectedItem as a notification's argument but the problem is how to pass it further to the DetailViewMediator. Should it be the special Proxy for that?

I found something similar in CafeTownsend demo: there is also a list of employees and a detail screen. But there is a ViewStack with creationPolicy="all" there which simplifies things a lot. A mediator in detailviewmediator just listens to the notification that is generated when list item is changed. In my case I have no mediator at that very moment when List item is changed. So I need register a mediator for the detail when user goes to the details screen. And after that get the value from ListViewMediator.

Thanks a lot,

« Last Edit: March 12, 2010, 06:18:34 by mico » Logged
Pages: [1]