tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/615-event-dispatching-from-model-setter-with-need-for-different-eventsRobotlegs: Discussion 2013-04-28T10:18:27Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/88591752011-07-29T14:32:20Z2011-07-29T14:32:20ZEvent Dispatching From Model Setter With Need For Different Events<div><p>I think there should be methods to sort an ArrayCollection IN
the model. The route should be like this:<br>
1. Your mediator dispatches an EventA or EventB on mouse action. 2.
A command is called and it calls a method on the model e.g.
model.sortDataByA() or sortDataByB() 3. At the end of that sort
method there can be an event dispatched e.g. DATA_UPDATE. In case
of an ArrayCollection, a view can listen to its changes. 4. If
you're using DATA_UPDATE approach it should be listened in
mediators and accordingly update its view.</p>
<p>You can parametrize and merge EventA and EventB and add a
sortMethod as a parameter and then have it distinguished in a
command or pass sortMethod to model's sort function.</p>
<p>Thanks,<br>
Mike</p></div>Michal Wroblewskitag:robotlegs.tenderapp.com,2009-10-18:Comment/88591752011-11-02T17:35:26Z2011-11-02T17:35:26ZEvent Dispatching From Model Setter With Need For Different Events<div><p>Feel free to reopen this discussion in case you have more
questions or you need further assistance with this issue. Please
open new threads for new issues.<br>
Thank you for posting<br>
Ondina</p></div>Ondina D.F.