Hi,
Can somebody explain to me what is the difference betwwen currentAppData and messages.store? When to use them and what is the maximum amount of data we can store or pass using them.
Thanks
Priya
Hi Priya,
In addition, the great thing about using the message center is that it broadcasts an event whenever data is stored in it. So, if you have a view that is expecting data from a fetch, you can store the results of that fetch in the message center and the view will then know when it was retrieved and stored and be able to do what it needs.
For example, I often do this in my views to know when I can store data in a grid:
CODE
//code snipped for brevity;
initView: function () {
this.registerMessageCenterListenerCallback(this._dispatcher);
},
_dispatcher: function (event) {
if (event.type === KONtx.messages.eventType && event.payload.key === "newsItems") {
this.controls.grid.changeDataset(event.payload.value.dataset);
}
}
- Ben