tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/702-what-is-the-best-practice-to-filter-dataRobotlegs: Discussion 2011-11-03T16:16:45Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/109380742011-10-28T08:51:20Z2011-11-01T16:03:25ZWhat is the best practice to filter data?<div><p>I have a list of incomming and outgoing messages that a service
writes into a model.<br>
I want to show a list of all messages in one view and the sorted
data of incomming and outgoing in 2 other views.<br>
Where do I filter the data?<br>
1. In the Model where I have all data and 2 functions that return
the filtered incomming and outgoing<br>
2. In a Controller that contain 2 lists (ongoing and incomming)<br>
3. In the Mediator (every view has the same dataProvider but
different filterFunction)</p>
<p>And if I omit the all-list and show just the incomming and
outgoing where is the best place then?<br>
I think directly having 2 lists in the model for incomming and
outgoing would be best?</p></div>andreastag:robotlegs.tenderapp.com,2009-10-18:Comment/109380742011-11-01T13:55:32Z2011-11-01T13:55:32ZWhat is the best practice to filter data?<div><p>Hi Brean,</p>
<p>Just wanted to let you know, that, for some reason, there was a
spam filter issue on the robotlegs forum.<br>
That’s why a few posts were visible on the list, but
couldn’t be opened, therefore they got no answers.<br>
Your post was one of them. Sorry for the inconvenience.<br>
You’ll get an answer pretty soon :)</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/109380742011-11-01T15:02:54Z2011-11-01T15:03:38ZWhat is the best practice to filter data?<div><p>Hello Brean,</p>
<p>if I was on your place I'll create a helper class. For example
DataSorter. I'm not sure about the nature of your data, but my
feeling is that such a sorting is not exactly for the model. Of
course if your data is actually a collection of complex VO objects
then maybe it will be better to put it there.<br>
By creating a helper with a nice API you will be able to use this
class in some other projects.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/109380742011-11-01T15:20:46Z2011-11-01T16:03:25ZWhat is the best practice to filter data?<div><p>My Question is about a week old, I already solved it:<br>
I am using Sort/SortField from mx.collections in the view <a href=
"http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/SortField.html">
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/...</a><br>
and use the same arraycollection for both, incomming and outgoing
messages but with different filterFunctions.<br>
This is view-logic after all (just present the data to the
user).</p></div>andreastag:robotlegs.tenderapp.com,2009-10-18:Comment/109380742011-11-01T15:51:10Z2011-11-01T15:51:10ZWhat is the best practice to filter data?<div><p>Hi Brean,</p>
<p>Glad you solved your issue.<br>
Don’t hesitate to ask other questions, if you have any.<br>
The robotlegs community is eager to help.<br>
The delay in response to this discussion was due to pure technical
issues. Sorry again for the inconvenience :)</p>
<p>Cheers,<br>
Ondina</p></div>Ondina D.F.