Different "views" of the same collection of ArrayCollection

Hello

How would be the best way to do this?

I'm going to simpify the problem, so it's quite fictitious...

Let's say I have a class, student:

public class student

{

public var name: String;

public var isActive:Boolean;

public var averageGrade:int; 0 = 1 A = 2 B = C, 3 = D (or other)

public var likesCabbage:Boolean;

}

I have a collection of all students in my school, called allStudents ArrayCollection.

Now, I want to display on a single screen, several views of this collection ArrayCollection:

1. all students (IE not filtered)

2. students where isActive = true;

3. students with an average grade of B or above

4. students who like cabbage.

Obviously, if I simply apply a filter to the collection ArrayCollection, it will have an impact on all of these points of view. So I need basically a filter that is limited to each component.

I could copy the ArrayCollection collection four times (a loop in the original and using addItem() to add each item to the new collections, so that they are not related) and apply a filter to each new collection, but this seems messy - and among other problems, the ArrayCollections news will not be linked to the original, so if this changes, others will not automatically be updated.

Is there a best practice for this situation?

Thank you!

ListCollectionView is your friend!

var unfiltered: ListCollectionView = new ListCollectionView (mySourceAC.list);

var active: ListCollectionView = new ListCollectionView (mySourceAC.list);

active. FilterFunction = activeFilterFunction;

class var: ListCollectionView = new ListCollectionView (mySourceAC.list);

graded.filterFunction = gradedFilterfunction;

Points of view all the wrap the same source so you only have to update that.

You may have to monkey with refresh() sometimes, but that's a small price to pay!

Tags: Flex

Similar Questions

  • Is there a way to create a button etc to get different views of the same page?

    I have a page full of product images and wants to give the viewer an option to choose the size of the images on the page. So far, I just had two different pages with the same images and created a hyperlink button to switch between views. The reason why I want to get the two points of view on the same page, is I want to use the same name for each page. Muse won't let me create two pages with the same name, so now I have a parent page "Products" (with large images) and its child page "products 2" (with the small images) with a hyperlink linking them. "» This also creates a problem in the menus, since the 'product 2' does not have the active menu bar.

    I have the same problem with the creation of the site in different languages. I would like to make a simple drop-down list with options "Suomi" and "English". What I have to create two different sites in two different languages and have just the hyperlink connect for example home pages?

    Thanks for the tips!

    You can use any number of widgets to create online pop-overs / hover pods / galleries. Lightbox to the ToolTip, anything is possible. The language issue to indeed create individual sites and crosslink them.

    Mylenium

  • Navto a different view on the same page

    Is it possible to use the navto command to access a different view in a page or is to work in a floating framework?

    Yes, using decimal numbers in your navto page number. For example, navto://myarticle#2.3 jumps to a place between the page 3 and 4, in an article of smooth scrolling.

    For examples, see the advice of DPS > Advanced overlays > scrolling image links.

  • How to view the different pages of the same doc PDF at the same time

    Hi, I am wondering how to view different pages of the same doc PDF at the same time. For example, I love to see certain content on page 1, while referring to page 4 of the explanation. It may be useful to add in for Acrobat if it is not now.

    Thank you

    Use: Window - Split.

    Saturday, October 24, 2015 19:49, daiyueweng [email protected]>

  • Using different filters on the same measure in single result table (view)

    I have a table of twelve columns, each column with different filters tailor-made same table actually. Say a filter column (several people existing on 01/01/2003) comes from people dimension (date_of_birth < = January 1, 2003 ""). Two filter in column b (number of people living in Bucharest between 1 January 2004 and 1 January 2006 "") is (between 2004 and 2006 date_of_birth) etc.
    How do I use column a & column b in the same table of results (view)? I need the different filters on the same table.

    Thank you!

    Published by: seiciu on March 27, 2010 08:51

    Hello
    This filter clause works.
    filter (using Date = current_date)
    filter (using Date = date'2010-01-01')
    filter (measures using the year between 2004 and 2006)
    Concerning

  • Lightroom can open 2 different photos at the same time display side by side?

    or if not, is there another program that can do this?

    What is behind this survey is the fact that I have to directly view and compare the 2 pictures of the bird even close together in the same time and location (in a level of detail) to determine that it was certainly better.

    Authorization of repairs to my most recent goal that is at stake here that I must first demonstrate the mfgr that lens is below standards and needs attention.

    I want to compare a picture of the bird in question with the above goal and one I know to be reliable strong.

    Please help in this mission.

    Thank you.

    HI Nikon D90 gent II,.

    YES - Lightroom TO compare 2 different photos at the same time. It also allows you to zoom in to areas and match zoom.

    In the LIBRARY module, make sure that your toolbar is open under the grate.

    You can press "T" on the keyboard to make it visible.

    Select both images and click on the area of comparison of X Y. My arrow in red below.

    The two images appears then side by side with a labeled as the "Select" and the other marked 'candidate '.

    You can click and drag the Zoom slider that appears now on the toolbar to zoom for both images.

    To align the images, you can click the lock in the toolbar to unlock

    Click on and drag on the image to align with the other, then click on the padlock to lock in place.

    Then you can zoom in easily all over the two images by using the Zoom slider at the same time for comparison.

    In fact, you can click the button of "Carousel", the one with the three grey squares to the right of the X Y button on the toolbar and to compare the images of 3 or more.

    TO remove an image, simply click on the X in the corner of the image, and it will be removed at the carousel compared so you can then get more unless you images.

  • How to set up a second monitor with a different view than the one on my laptop? [was: ron]

    I'm trying to set up a second monitor with a different view than the one on my laptop.  I have a HP Pavilion dv5 laptop and a secondary monitor View Sonic UP2365-LED.  They are connected with a cable 15 pin... my only choice on the laptop.  When I select the second monitor, it displays a box of a second on my laptop and the secondary monitor.  My pointer moves on both screens at the same time, no matter what display, I select the monitor 2.

    It depends on the whther the laptop can support both points of view.

    Somewhere with the right button on the desktop, choose "screen resolution" and that there should be only a drop down menu entitled "multiple displays".  Looks like you have "displays a duplicate" choose (if it will leave you) "to extend these screens.

  • appearing in two different colors at the same time container attached screenshot.

    post.JPGHello

    I am very impressed with this site's Look, you can see that
    in this the container showed up in two different colors at the same time as shown in the attached screenshot.

    Please tell me how to get there?

    A part is loading advertising and other view their business rules.

    Please tell me how to get this behavior

    Because when I use the Application container = 'black' background color, it displays the container integer oiail color.

    Help, please

    Thanks in advance.

    There are many ways to achieve this. We can be to use the background image for the application. Other means may be to use various containers (Panel, canvas etc with background pictures) to get this look. Think of it in HTML view. How you can use the div tags to your page layout, you can use various containers of Flex to your page layout.

  • can I display different tables at the same time?

    Hi all

    It is probably a newbie question, but is it possible to display different tables at the same time? I use SQL Developer 1.5.5 and I seem to be unable to display several tables at the same time, whenever I chose to open another table, the old table disappears. In other words, the Bulletin Board only switches to your new choice in the table list navigation. Any ideas anyone?

    Kind regards
    WF

    Menu item "Tools-> Preferences-> database-> ObjectViewer Parameters"; Make sure that "automatically freeze object viewer Windows" is checked.

    HTH.

    Hrsg.:.

  • Cropping multiple pictures on different pages at the same time

    Can I culture several images on different pages at the same time. In my french version of software Photos 1.5, this option is called "the photo to the frame adapter". I'm able to select this image of an option at a time, but could not find a way to make the entire book in one click.

    No there is no functionality like this in Photos

    You can ask Apple to add the - http://www.apple.com/feedback/photos.html

    LN

  • I have 2 different accounts on the same sites. Whenever I go on this site, one of my usernames prefills the field of the United Nations, and I can't access the other account. I can't replace my pre-filled username. Ideas?

    I have 2 different accounts on the same sites. Whenever I go on this site, one of my two (always the same) identifiers pre fills in the username field and I can't access the other account. The Web site legitimately refuse my password. I can't replace my username pre-populated because the second I hit enter to open a session, the initial username is rewritten in its field. Or user names is registered by firefox anywhere in the "Tools"; Options, security, advanced, or fields from the privacy menu.

    I noticed that this Web site has installed a cookie on my computer called "_rememberme" that contains the user name plaguing me.

    This is a Web site that I have access to very sensitive and important information, and I have to have two accounts available at different times.

    Thanks, Joshua
    XP, sp3; FF3.6.3

    This has happened

    A few times a week

    == I added the second account on this Web site.

    You will need to disable that remember me cookie, and make sure that you remove a tick to remember you on this Web site.
    Tools > Options > privacy > Cookies: "show the Cookies".

    You can disable the automatic filling of a name and a password.

    See:
    http://KB.mozillazine.org/Password_only_filled_after_entering_user_name
    http://KB.mozillazine.org/signon.autofillForms

    To open the topic: config page, type Subject: config in the address bar (address) and press the Enter key, as you type the url of a Web site to open a Web site.
    If you see a warning then you can confirm that you want to access this page.

  • Why does my 7th generation nano play different versions of the same song (acoustic, demo, replacing) one after another before she switches to a different song.

    Why does my 7th generation nano play different versions of the same song (acoustic, demo, replacing) one after another before she switches to a different song?

    Maybe the current list of the song has the songs listed in alphabetical order, and you have the iPod nano to play in the order of the list...  How do you think iPod nano to read the list of songs?

  • can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    Yes. The only problem that I see if Macs were different countries. The method of payment in the account/ID must be associated with the country where the unit is located and you can only buy Apps from the store of the country where the computers are located

  • I want to buy an iBook. There are 2 different books with the same name, author, and the book cover. They are different number of pages with different prices. Specifically, all the light that we do not see. " How do you know that we purchase?

    I want to buy an iBook. There are 2 different books with the same name, author, and the book cover. They are different number of pages with different prices. Specifically, all the light that we do not see. " How do you know that we purchase?

    I would get one that has 4700 comments already.

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

Maybe you are looking for