Collection ArrayCollection CFC filtering

All,

I followed the method of Forta filtering of data that can be found here http://www.forta.com/blog/index.cfm/2006/7/13/Filtering-Data-In-Flex.

The difference with what I do is I get my data to a CFC. I get the following error during execution:

TypeError: Error #1009: cannot access a property or method of a null object reference.
tests /: initApp()

Here is my code, any suggestions?


<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml '
creationComplete = "initApp ()" >

< mx:Script >
<! [CDATA]
Import mx.controls.Button;
Import mx.collections.ArrayCollection;
Import mx.rpc.events.ResultEvent;
Import mx.controls.Alert;

[Bindable] private var employees: ArrayCollection collection;

private function initApp (): void {}
qryUsers.selectAll ();
Employees.filterFunction = processFilter;
}

private void myMethodResult(event:ResultEvent):void {}
Employees = event.result as ArrayCollection collection;
}

public void processFilter(item:Object):Boolean
{

var result: Boolean = false;
If (! point.) FirstName.length | order of the day. FirstName.toUpperCase () .indexOf (txtSearch.text.toUpperCase ()) > = 0)
result = true;

return the result;
}
[]] >
< / mx:Script >

< mx:RemoteObject id = "qryUsers" source = "employees" destination = "ColdFusion" fault = "Alert.show (event.fault.message)" >
< name mx:method = "selectAll" result = "myMethodResult (event)" / > "
< / mx:RemoteObject >

< mx:Panel x = "10" y = "0" width = "100%" height = "100%" layout = "absolute" title = "employee list" >
< mx:Canvas label = "Employee list" width = "100%" height = "536" x = "0" y = "0" >

< mx:DataGrid x = "0" y = "64" width = "100%" height = "246" id = "employeeList" dataProvider = "{employees}" >
< mx:columns >
< mx:DataGridColumn headerText = "First name" dataField = "FirstName" / >
< mx:DataGridColumn headerText = "Last Name" dataField = "LastName" / >
< mx:DataGridColumn headerText = "Email" dataField = "EmailAddress" / >
< mx:DataGridColumn headerText = "Department" dataField = "Department" / >
< / mx:columns >
< / mx:DataGrid >

< mx:Button x = "10" y = "555" id = "btnEdit" label = "├editer" enabled = "false" / >
< mx:Button = "66" x y = '555' label = 'Add' used / >
< mx:TextInput = x '427' y = '20' id = 'txtSearch"change ="Employees.refresh ()"/ >
< mx:Label '372' = x y = "22" text = "search:" / >

< / mx:Canvas >
< / mx:Panel >

< / mx:Application >

Nevermind, figured it out. When you use a call to the remote object, you must add the parameter of the function filterFunction in the result of your remote object service: P

Tags: Flex

Similar Questions

  • Enter the filtered items in collection ArrayCollection after such FilterFunction

    It is an easy one. I have my filtering function, but rather than use main ArrayCollection collection after it has been filtered, I want to retrieve all filtered items and pass them in another collection ArrayCollection.

    private var allScreens:ArrayCollection;

    [Bindable]
    private var filteredScreens:ArrayCollection;

    private void filterFunc(value:Object):Object
    {
    If (Number (value.module_number) == 1)

    {
    Returns true;
    }
    Returns false;
    }


    private void filterSuff(value:Object=null):void
    {
    allScreens.filterFunction = filterFunc;
    allScreens.refresh ();

    for (var i: int = 0; i < allScreens.length; i ++)
    {
    If (allScreens.getItemAt (i) .module_number == 1) {}
    filteredScreens.addItem (allScreens.getItemAt (i) .filename);
    }
    }

    trace (ObjectUtil.toString (filteredScreens));
    }

    Hmm, addAll() is a function for the ArrayCollection with Flex SDK 3.3 collection, but I guess not in some versions.  A loop could perform the same function.

    var point: Object;

    for each (item in the original)

    {

    filtered.addItem (item);

    }

    Let me know if it does the trick.

    Ben Edwards

  • collection ArrayCollection collection arraycollection assigned values from the original setting?

    Hi... I am pretty stumped on this one. Here's the situation... on my main flex app I define an arraycollection collection:

    public var fiscalYrsArray:ArrayCollection;

    The collection is filled with the results of a query to a CFC

    protected function fiscalYrs_resultHandler(event:ResultEvent):void {}

    for (var x: int = 0; x < event.result.length; x ++) {}

    If (event.result [x]. DATA == passData.filterFiscalYrs) {}

    Event.Result [x]. Assigned = true;

    }

    }

    fiscalYrsArray = event.result as ArrayCollection collection;

    }

    I have a main application with drop-down menus window (I use a multi-case combobox). I use this window as a filter window, where users can choose what they want filtered.

    on this component, I use a temporary arraycollection collection (b/c I don't want to change the assignments of the arraycollection the temp collection is based off of) which will be a copy of the fiscalYrsArray of the parentApplication collection:

    " < = xmlns:fx s:TitleWindow ' http://ns.Adobe.com/MXML/2009 'close = "PopUpManager.removePopUp (this)'

    xmlns:s = "library://ns.adobe.com/flex/spark" title = "filter data" creationComplete = "initComp (); »

    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "400" height = "300".

    xmlns:multiPickBox = "Components.multiPickBox. *" >

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < / fx:Declarations >

    < fx:Script >

    <! [CDATA]

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import mx.managers.PopUpManager;

    private var tempfilterFiscalYrs:String

    [Bindable] private var fiscalYrDP:ArrayCollection = new ArrayCollection collection;

    private function initComp (): void {}

    fiscalYrDP = parentApplication.fiscalYrsArray;

    tempfilterFiscalYrs = parentApplication.passData.filterFiscalYrs;

    }

    protected function msc_addItemHandler(event:Event,filterVal:String,comboId:String):void

    {

    Alert.Show ("get here '");

    This [filterVal] = ";

    {for each (var point: Object in {this [comboId] .selectedItems)}

    This element of += [filterVal] ['DATA'] + ",";

    }

    filterChange = true;

    idText.text = str;

    }

    I am lie the collection arraycollection filterYrDP to a custom choice multi combobox:

    < multiPickBox:CheckCombo id = "fiscalYearF" width = "162" dataProvider = "{fiscalYrDP}".

    addItem = "msc_addItemHandler (event, 'tempfilterFiscalYrs', 'fiscalYearF')" "

    allIndex = '0' x = "77" y = "17" labelField = "DATA" / >

    However, I find that when an element is activated the assigned = true value is actually applied to the fiscalYrsArray of my parentApplication origin. I just want the assigned = true to apply to the fiscalYrDP collection arraycollection (one that is based on the fiscalYrsArray of parentApplication). How could it be written back and changing the properties of a fi main is just a temporary copy?

    By assigning the table using "=" you are just assigning the same table - in the same memory location.

    If you want to keep a separate table, you use the function ObjectUtil.copy

    import mx.utils.ObjectUtil;
    
    arrNewData  = new ArrayCollection();
    arrOldData  = ObjectUtil.copy(arrNewData) as ArrayCollection;
    
  • Problem with allocating memory collection arraycollection by AddItem

    I have a strange problem with the AddItem method.

    I made a new item with this code:

    ------

    for (var u: int = 0; u < 41; u ++) {}
    Page = new PageToSave();
    project.addPage (page as PageToSave);
    }

    -----

    the project is a distance of class projectblueprint:

    package marcoDoItBetter.utils
    {
    Import mx.collections.ArrayCollection;
    public class ProjectBlueprint
    {
    private var _pages:ArrayCollection;

    public void addPage(page:PageToSave):void
    {
    This._pages. AddItem (page);
    }

    }

    }

    ----

    PageToSave is a class that extends the object.

    When we create the element using the addPages (so with in the collection _pages arraycollection's addItem) programmatically, we have this result using the term Inspector in debug mode.

    It is on the output of the debugger:

    pageList = mx.collections.ArrayCollection (@105cf341)
    [inherited] =
    [0] = marcoDoItBetter.utils.PageToSave (@113cb461)
    [1] = marcoDoItBetter.utils.PageToSave (@113cb401)
    [2] = marcoDoItBetter.utils.PageToSave (@113cb3a1)
    [3] = marcoDoItBetter.utils.PageToSave (@113cb341)
    [4] = marcoDoItBetter.utils.PageToSave (@113cb2e1)
    [5] = marcoDoItBetter.utils.PageToSave (@113cb281) < -.
    [6] = marcoDoItBetter.utils.PageToSave (@113cb221)
    [7] = marcoDoItBetter.utils.PageToSave (@113cb1c1)
    [8] = marcoDoItBetter.utils.PageToSave (@113cb161)
    [9] = marcoDoItBetter.utils.PageToSave (@113cb101)
    [10] = marcoDoItBetter.utils.PageToSave (@113cb0a1)
    [11] = marcoDoItBetter.utils.PageToSave (@113cb041)
    [12] = marcoDoItBetter.utils.PageToSave (@1140dfa1)
    [13] = marcoDoItBetter.utils.PageToSave (@1140df41)
    [14] = marcoDoItBetter.utils.PageToSave (@1140dee1)
    [15] = marcoDoItBetter.utils.PageToSave (@1140de81)
    [16] = marcoDoItBetter.utils.PageToSave (@1140de21)
    [17] = marcoDoItBetter.utils.PageToSave (@1140ddc1)
    [18] = marcoDoItBetter.utils.PageToSave (@1140dd61)
    [19] = marcoDoItBetter.utils.PageToSave (@1140dd01)
    [20] = marcoDoItBetter.utils.PageToSave (@1140dca1)
    [21] = marcoDoItBetter.utils.PageToSave (@1140dc41)
    [22] = marcoDoItBetter.utils.PageToSave (@113cb281) < -.
    [23] = marcoDoItBetter.utils.PageToSave (@1140db81)
    [24] = marcoDoItBetter.utils.PageToSave (@1140db21)
    [25] = marcoDoItBetter.utils.PageToSave (@1140dac1)
    [26] = marcoDoItBetter.utils.PageToSave (@1140da61)
    [27] = marcoDoItBetter.utils.PageToSave (@1140da01)
    [28] = marcoDoItBetter.utils.PageToSave (@1140d9a1)
    [29] = marcoDoItBetter.utils.PageToSave (@1140 d 941)
    [30] = marcoDoItBetter.utils.PageToSave (@1140d8e1)
    [31] = marcoDoItBetter.utils.PageToSave (@1140 d 881)
    [32] = marcoDoItBetter.utils.PageToSave (@1140 d 821)
    [33] = marcoDoItBetter.utils.PageToSave (@1140d7c1)
    [34] = marcoDoItBetter.utils.PageToSave (@1140 d 761)
    [35] = marcoDoItBetter.utils.PageToSave (@1140 d 701)
    [36] = marcoDoItBetter.utils.PageToSave (@1140d6a1)
    [37] = marcoDoItBetter.utils.PageToSave (@1140 d 641)
    [38] = marcoDoItBetter.utils.PageToSave (@1140 d 221)
    [39] = marcoDoItBetter.utils.PageToSave (@1140d5e1)
    [40] = marcoDoItBetter.utils.PageToSave (@1140 d 461)
    source = Array (@1140c9a9)

    as you can see the [5] and the [22] PageToSave id internal flex (or instances of the class has the same address listing.

    "I don't know the exact name of it). It happens totally randomly.

    sometimes fine, sometimes there's more than a duplicate with random address referencing the game.

    I don't want duplicated instances, but I want independent authorities.

    I tried to change addItem with

    This._pages.addItemAt (page, 0);

    Same result.

    I also tried pagina = null before the statement new but same result

    ------

    for (var u: int = 0; u < 41; u ++) {}
    Page = new PageToSave();
    project.addPage (page as PageToSave);

    Page = null;
    }

    -----

    is a garbage collector from?

    How can we solve this problem?

    Thank you

    Hello

    From the looks of it, looks like a bug.

    Are you defining filters or performs a sort on the ArrayCollection collection? Or it's just a pure naked collection instance ArrayCollection.

    Have you tried addItemAt() and got the same result?

    Mike

  • Filter collection arrayCollection based on elements in another table?

    I have a table that contains several values: ["361 364"] = array1

    Here's the id references that change frequently.

    I have an arrayCollection collection that contains a bunch of files. I have experience of writing code to perform simple filtering of my collection arrayCollection using the filterFunction function and a simple piece of criteria.

    I am trying to reach a loop for filtering my arrayCollection collection to look at the number of element in array array1 and then filter my arrayCollection collection, leaving only entries that match the id numbers in array1.

    I am using a ".. for each" loop but I do not understand the result I need...

    Sample:

    public var matchingID:int:

    private function filterArray (): void
    {
    for each (var i: int array1)
    {
    matchingID = i;
    arrayCollection.filterFunction = checkIDs;
    }
    arrayCollection.refresh ();
    }

    private void checkIDs(item:Object):Boolean
    {
    If (item.id is matchingID)
    {
    Returns true;
    }
    on the other
    {
    Returns false;
    }
    }


    When I run this code I find myself alone with a collection consisting of single entry, arrayCollection which is the last. My brain is frozen trying to understand this one. The values and the amount of values will vary in array1 I am looking for a loop of filtering for arrayCollection collection that works no matter how many values of array1 is.

    Any creative ideas?

    You wanted to probably say array1 = [361, 364], right?

    Try this.

    TS

  • CFC FILTERS

    Hello

    Can someone tell me if the filters of CFC SAEJ211 was delivered as part of the basic DIAdem or Crash analysis toolkit version...

    Hello a rash.

    CFC filters are part of the Crash Analysis Toolkit, which can be added to the Basic, advanced and professional tiara.

    Hope that helps,

    Otmar

  • Error creating collection ArrayCollection getResourceBundle

    Hi I have just the following line of code in a new 0.9.2

    var a : ArrayCollection = new ArrayCollection();
    

    which result in a runtime error.

    TypeError: Error #1006: getResourceBundle is not a function.

    at mx.collections::ListCollectionView$cinit()

    Global $init () [C:\dev\GMC\sdk\frameworks\mx\collections\ListCollectionView.as:73]

    Global $init () [C:\dev\GMC\sdk\frameworks\mx\collections\ArrayCollection.as:59]

    to PlaybookMobileApp() [/ Users/anthonymccormick/Documents/FlashBuilderProjects/PlaybookMobileApp/src/PlaybookMobileApp.as:19]

    Should I not use ArrayCollections? and if not, do I need to use?

    Thanks in advance

    Anthony.

    Hi anthony,.

    from the looks of it the collection ArrayCollection class is available only if you are coding in Flex (MXML). Since you only use ActionScript, you cannot use this class. Now depending on what you want to achieve with your application, there are different equivelents. on the fly, your best bet will be to use the DataProvider class in the catalog of QNX API:

    http://www.BlackBerry.com/developers/docs/airapi/1.0.0/QNX/UI/data/dataProvider.html

    hope that helps. Good luck!

  • Can anyone confirm that groups of Nik Collection plug-in filters are compatible with 13 PS elements? Thank you

    I am considering the purchase of 13 PS both the Nik Collection of Google - plug-in filters for use with PS Elements. The Collection of Nik is a package of 6-7 groups of plug-in filters. Someone told me that NOT ALL the Nik plug-ins filters are compatible with PS 13 items. I thought I would ask the source. Can anyone confirm that groups of Nik Collection plug-in filters are compatible with 13 PS elements? Thank you

    Hi jimc,

    HDR Efex Pro 2 is the only group of plugin is not compatible with Photoshop Element 9 to 13, still other groups plugin works fine with Photoshop elements 13.

    See link: Google Nik Collection

    It will be useful.

    Kind regards

    ~ Mohit

  • GetItemAt collection ArrayCollection

    I want to return the index of an item in a collection of ArrayCollection for setting the selected index of a drop-down list box

    [Bindable] public var time: collection ArrayCollection = new ArrayCollection () collection
    ([{label: "01:00", data: "01:00:00"}, {label: '01:15 ', data: "01:15:00"}, {label: "01:30", data: "" 01:30:00 ""}]);

    The following does not work.

    var point: Object = new Object();
    Item = {data: "01:15:00"};
    This. RepairBySelected = times.getItemIndex (item);

    A string value of "01:15:00".

    How can I return a value of 1 at the time collection (the this value index) ArrayCollection?

    Thank you

    Dan

    Daniel Pride wrote:

    Give the ArrayCollection collection

    [Bindable] public var time: collection ArrayCollection = new ArrayCollection () collection
    ([{label: "01:00", data: "01:00:00"}, {label: '01:15 ', data: "01:15:00"}, {label: "01:30", data: "" 01:30:00 ""}]);

    Give me a use of GetitemIndex which returns the index of the element in the second list. (1)

    Thank you

    Dan

    Yes, Mr President.

    public var _entry:Object = {label: "01:15", data: "01:15:00"};

    public var _entry2:Object = {label: "01:15", data: "01:15:00"};

    [Bindable] public var time: ArrayCollection collection = new collection ArrayCollection ([{label: "01:00", data: "01:00:00"}, _entry, {label: "01:30", data: "01:30:00"}]);

    trace ("" + Times.GetItemIndex (_entry) +', '+ times.getItemIndex (_entry2));

  • return index collection ArrayCollection-1 after updating in datagrid

    When I called data.refresh ();  arraycollection.getItemIndex (obj1) returns-1

    is anyway to make it work properly or work around?

    <? XML version = "1.0" encoding = "utf-8"? >

    "" < s:Application xmlns:fx = "http://ns.adobe.com/mxml/2009"

    "xmlns: s="library://ns.adobe.com/flex/spark"preinitialize ="application1_preinitializeHandler (event) ".

    xmlns:MX ="library://ns.adobe.com/flex/mx"minWidth = "955" = "600" xmlns:local = minHeight"*" > "

    < fx:Script >

    <! [CDATA]

    Import mx.collections.ArrayCollection;

    Import mx.collections.Sort;

    Import mx.events.FlexEvent;

    private var data: ArrayCollection collection;

    private var obj1:Object;

    protected function application1_preinitializeHandler(event:FlexEvent):void

    {

    obj1 = {'name': '1'}

    data = new ArrayCollection();

    data.addItem (obj1);

    data.addItem({"name":"2"});)

    trace (Data.GetItemIndex (obj1)); 0

    var sort: sort = new Sort();

    sort.compareFunction = nameSort;

    Data.sort = sort;

    data .filterFunction = null;

    Data.Refresh ();

    -1 trace (Data.GetItemIndex (obj1))

    }

    private void aa (): void {}

    }

    private void nameSort(m1:Object,_m2:Object,arr:Array=null):int {}

    Returns - 1;

    }

    []] >

    < / fx:Script >

    < fx:Declarations >

    < / fx:Declarations >

    < / s:Application >

    A comparison function sorts must return 1, 0 or - 1 on a consistent basis.  He

    cannot simply return-1.

  • Problems using collection ArrayCollection as a DataProvider for trees and the menu bar, possibly bug?

    Hi guys,.

    I'm having some troble using a collection ArrayCollection as a DataProvider for a tree and a menu bar...

    I read some Adobe documents on this subject, and I read that two components read the dataProvider in the same way.

    but my current works of DataProvider well on the tree, but not on the MenuBar component...

    My dataProvider is an ArrayCollection collection of a custom class (which extends from ArrayCollection collection), and among its assets is a children's collection: ArrayCollection, so the hierarchy can be read correctly.

    When I use the component of the tree it works, but the menu bar do not display the branches...

    Can someone help me?

    Here's the function that create my dataprovider:


    private function fnFillDP (): void {}
    for (var i: int = 0; admResult.length > i; i ++) {}
    If (.nivel JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]) == 0) {}
    var novoMenu:CL_ArrayMenu = new CL_ArrayMenu();
    novoMenu.idMenu = .idMenu JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenu.titulo = .titulo JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenu.parent = .parent JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenu.nivel = .nivel JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenu.ordem = .ordem JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);

    dataProvider.addItem (novoMenu);
    } ElseIf (.nivel JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]) == 1) {}
    for (var j: int = 0; dataProvider.length > j; j ++) {}
    {If (CL_ArrayMenu(dataProvider[j]).idMenu == {JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]) .parent})}
    var novoMenuChildren:CL_ArrayMenu = new CL_ArrayMenu();
    novoMenuChildren.idMenu = .idMenu JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenuChildren.titulo = .titulo JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenuChildren.parent = .parent JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenuChildren.nivel = .nivel JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    novoMenuChildren.ordem = .ordem JV_MenuAdm (JV_AuxMenuAdm(admResult[i]).menuAdm [0]);
    If (dp.length > 0) {}
    If (CL_ArrayMenu (dp.getItemAt (0)) .parent == novoMenuChildren.parent) {}
    dp.addItem (novoMenuChildren);
    } else {}
    DP = new ArrayCollection();
    dp.addItem (novoMenuChildren);
    }
    } else {}
    dp.addItem (novoMenuChildren);
    }

    CL_ArrayMenu (DataProvider [j]). Children = dp;
    break;
    }
    }
    }
    }
    tree.dataProvider = dataProvider;
    menu.dataProvider = dataProvider;
    }

    Sorry for the bad English...

    Hello

    You can try using xml as the dataprovider of the Menu bar instead of going for the Arraycollection collection.

    Thank you

    Roman

  • Help needed to convert the ArrayList collection ArrayCollection


    I am converting an ArrayList (Java) to the collection of Flex ArrayCollection.
    Please help me in this, I don't know whether there is a correct approach

    I have a created a class user VO ActionScript Flex with two properties as uname, pass.

    [Bindable]
    var result: ArrayCollection collection

    private void displayDetails(event:ResultEvent):void
    {
    result = event.result as ArrayCollection collection;
    }


    < mx:DataGrid dataProvider = "{result}" >
    < mx:columns >
    < mx:DataGridColumn headerText = "UserName" dataField = "uname" / >
    < mx:DataGridColumn headerText = "Password" dataField = "pass" / >

    < / mx:columns >
    < / mx:DataGrid >

    It's my DAO of Java file:


    ResultSet rs = stmt.executeQuery ("select NAME, PAST by users");
    list = new ArrayList();
    While (RS. Next {}
    User user = new User();
    user.setUname (rs.getString (1));
    user.setPass (rs.getString (2));
    List.Add (User);

    }


    back list;

    With the code below, the DataGrid displays is empty without data, please help me where I am wrong doung

    I have to do something more? The data comes on the lcds Server console.

    Help, please.

    Hi Kiran,

    Try this once...

    private void displayDetails(event:ResultEvent):void
    {
    result = new collection ArrayCollection (event.result as Array);

    }

    Just try to debug by placing the stop point and make sure that you have found event.result as array... If not, then change your code accordingly.

    Thank you

    Jean Claude

  • How to copy an arraycollection variable collection to another collection arraycollection variable but any change in a var

    Hi all

    I want to create a copy of the collection arraycollection from a table of existing collection variable.

    but when I change the collection newly created arraycollection variable that is showing the other oldest.

    How can I protect the changes the new is does not reflect the older one.

    I use the code below

    var aa:ArrayCollection = new ArrayCollection();

    var aa1:ArrayCollection = new ArrayCollection (aa.source.concat ());

    Thanks in advance;

    Hi Niranjan,

    You can make use of ObjectUtill class to clone, or make a copy of a collection arraycollection.

    In the forum, he is also already talked several times...

    var aa:ArrayCollection = new ArrayCollection();

    var aa1:ArrayCollection = ObjectUtil.copy (aa) like collection ArrayCollection;

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • changing the collection arrayCollection changes other arrayCollections

    Hello

    I need to create a collection arrayCollection as a copy of another collection arrayCollection. Then I need to change some data within the copy, but when I do that collection as well original arrayCollection changes. Is there a way to prevent changes in the original arrayCollection collection?

    For example, I got: .someVar arrColOrig [0] = 1

    I tried:

    arrColCopy = new arrayCollection (arrColOrig.source) collection

    arrColCopy [0] .someVar = 2

    effect is that .someVar arrColOrig [0] = 2

    I also tried:

    ARR = new Array

    ARR = arrColOrig.source

    arrColCopy = new arrayCollecion (arr);

    arrColCopy [0] .someVar = 2

    effect is that 'someVar' changes to the value '2' in arr and arrColCopy and arrColOrig

    So is it possible to retain the original unchanged arrayCollection collection? I know that I can create the copy by a loop of the original arrayCollection collection, but I'm looking for an easier way.

    Hello

    It's what happens when you do things from the top of your head, I forgot the important bit...

    Arr2 = ObjectUtil.copy (arr1) as ArrayCollection collection;

    David

  • How to browse the collection ArrayCollection?

    I have two datagrids and you want to move items on datagrip and fill the other.  Here is a screenshot of a Visual screen.

    Picture 1.png

    In the screenshot on I can add some names/sex to the datagrid on the left using the text input and the Add button.  I can select the checkboxes for each name of ros as well. I want to do is move the check names in the datagrid control on the left for the datagrid on the right.  4 max.  But if I chose only 2 name, both names would be added to the 1 Racer and Racer 2. Runner 3 and 4 of the race would be left blank.  If I check the new names and submitted it would be in a new line on the left data grid.

    What I can understand is to scroll the datagrid control left and find only the lines of control.  To the right of the datagrid can be quite easily as soon as I figure out how to identify what is checked and what is not checked.

    This is the datagrid on the right.

    "" " < mx:DataGrid x ="10"y ="76"height ="337"id ="list"editable ="false"dataProvider =" rosterArray{}">

    < mx:columns >

    < mx:DataGridColumn headerText = "" width ="30">

    < mx:itemRenderer >

    < mx:Component >

    < mx:CheckBox / >

    < / mx:Component >

    < / mx:itemRenderer >

    < / mx:DataGridColumn >

    "" < mx:DataGridColumn headerText = "name" dataField ="name" width = "200" "editable ="false" / >

    "" < mx:DataGridColumn headerText = "sex" dataField ="sex" width = "40" "editable ="false" / >

    "" < mx:DataGridColumn headerText = "time" dataField ="time" width = "45" editable ="false" / >

    < / mx:columns >

    < / mx:DataGrid >

    The function add to my rosterArray (left datagrid) is below.

    private function rosterAdd():void

    {

    rosterArray.addItem({name:addName.text,sex:sexGroup.selectedValue.toString()});)

    addName.text = ""; empty text entry field.

    }

    I guess I have to scroll datagrid and not the rosterArray because I don't have a place for the checkmarks in the rosterArray.

    Any help idetifying which lines are checked in the left data grid would be much appreciated.

    Thank you.

    This code is not production level, but it should answer your question.

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Flex / development, training, AIR and Support Services

    
    
      
        
      
      
      
        
          
          
            
            
            
            
          
          
            
              
                
                  
                    
                      
                        
                          
                        
                      
                    
                  
                
              
              
              
              
            
          
          
        
        
          
          
            
              
              
              
              
            
          
          
        
      
    
    

Maybe you are looking for

  • password Microsoft autoupdate

    How can I find the password so that I can do a Microsoft AutoUpdate. I contacted Microsoft very useful, but they said it was a problem for Apple. Your help would be greatly appreciated.

  • Rise of Nations expension pack problem.

    I bought yesterday rise of Nations Gold (Ubisoft Exclusive version). When I try to install Thrones & Patriots expansion pack he asks me the cd key. And when I write the cd key it does not accept. I installed RoN with the cdkey without problem. What s

  • All my programs have disappeared from my Start menu.

    I have Windows XP and in the menu start, tap all programs that all gone nothing's gone and it's the same thing in Add and Remove Programs Control Panel... Theres NOTHING in the add and remove programs and I have no idea how to fix this or how still h

  • copy of a dvd/data disc using vista

    I have a HP desktop computer and an operating system vista Home premium I tried unsuccessfully to copy a dvd/data disc using windows media player 11 and Windows media center... Nothing works. I thought I have to first transfer the files from the dvd

  • PIX 515E - VPN connections

    Hello I have pix 515E and I configured a VPN on it. My users connect to my network from the internet via the Cisco VPN client. I have problem, only their LAN machine can do VPN from Cisco VPN client to my network at once. Users are connected to the i