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

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Getting Started / Clarification on data-binding best practice for Flex/Flash on: October 18, 2007, 09:25:26
In the Best Practices document, the very last paragraph (p. 34) states: "Another Mediator has previously expressed interest in that particular Notification and responds by retrieving the Proxy, and setting the dataProvider property of its stewarded View Component to the result property of the Proxy."

Do I understand this right: Assume I have a DataGrid in my view component and an object in the Model that has an ArrayCollection object to represent the data.  The view mediator component can retrieve the proxy for the data and obtain the model's ArrayCollection and set the DataGrid's dataProvider property, thus directly binding the model's ArrayCollection to the view's DataGrid for display?

Is that what you meant in this paragraph?  Or should the View in this case actually have another ArrayCollection and when the View mediator receives notifications that the model's data has been updated the mediator should retrieve the contents of the model's ArrayCollection (via the proxy of course) and modify the contents of the view's ArrayCollection to match?

The big issue for me is if I make the DataGrid allow editing when I have directly bound the model's ArrayCollection to the view's dataProvider.  In this case, unless I take special care to intercept the item edits, the resultant change will be bound directly back to the model's ArrayCollection without invoking the methods exponsed by the model's proxy or using a command to do such.

(I guess my lack of OOD roots is showing, but I'm trying hard to catch on to this paradigm as fast as I can!)
Pages: [1]