collection of table question

Hello I am new to flex I read books and what not, but I have a probably simple question for someone more experienced.

So here's what I want to do I have a table collection _getNews and I want to get information out of him by the statesFilterFunction the field I want in the table collection is called fkstate_id so make reference as follows

_getNews.data.fkstate_id
or
_getNews.fkstate_id

in any case I get an error message 1119 = possibly indefinite access to property data referring to a static type

Basically, I want to get the info on my _getNews collection property of table and compare it to a different function of another property get_States

Any help would be great

Thank you

[Bindable]
private var _getNews:ArrayCollection;

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

}

private void statesFilter(_getStates:Object):Boolean
{
var currentCountry:Object = countryList.selectedItem as an object;
return (currentCountry.country_id == _getStates.fkcountry_id & & _getNews.fkstate_id == _getStates.state_id);
}

So I just did a loop in my function filterFunction and worked very well, thanks to all who have helped me

VTRT

private void statesFilter(_getStates:Object):Boolean
{
var currentCountry:Object = countryList.selectedItem as an object;
var result: Boolean = false;
for (var i: int = 0; i< _getnews.length="" ;="">
{
var point: Object = _getNews;
If (currentCountry.country_id == _getStates.fkcountry_id & .fkstate_id item.getItemAt (i) == _getStates.state_id)
{
result = true;
}
}
return the result;
}

Tags: Flex

Similar Questions

  • Remove all items from a Collection of table

    Small question. What is the code to remove all the elements of a collection of table?

    I have a collection of table {myTilelistAC}, which is referred to as the data provider for my tilelist and I have a button that when clicked will be empty this collection of table, so that the tilelist component will be mainly empty too.

    ArrayCollection.removeAll ();

  • Collection of table sorting or Listbox

    I need to sort a collection of table or a list box.  I tried the example collection ArrayCollection and it ran without errors but do you not sort.

    kind of varort = new Sort();
                    
    There isn't that one sort field, so use a null value
    first parameter.
    SortField varortField = new SortField ("null", true);
                    
    sortfield.setStyle("locale","en-US");
    fate. Fields = [sortfield];
    myAC.sort = sort;
                    
    myAC.refresh ();

    Is there a way to sort the listbox control in ascending order?  The ArrayCollection collection contains the same data, which is just names.

    Neil

    Have solved it.  I had to change the

    SortField varortField = new SortField (null, true);

    TO

    SortField varortField = new SortField (null, false);

    Neil

  • Searching for an object in a Collection of table

    So I have a Collection of table with an object in, the following trace output

    (mx.collections::ArrayCollection)#0
      filterFunction = (null)
      length = 1
      list = (mx.collections::ArrayList)#1
        length = 1
        source = (Array)#2
          [0] (Object)#3
            fileName = "belt_002"
            filePath = "/mens/belts/"
        uid = "2EA13990-EEBA-BDD7-8E55-532927494C53"
      sort = (null)
      source = (Array)#2
    

    When you add items to the collection of table I want to check that there is no such thing as an object with the same properties.

    So, how can I check that the object above is not already in the table, basically that there is no corresponding file name and filePath?

    Thanks for your help

    Hello

    Try this:

    protected function componentsCheckList_changeHandler(event:IndexChangeEvent):void
                {
                    if (_secdataProvider.length==0){
                        _secdataProvider.addItem(event.currentTarget.selectedItem);
                        _secdataProvider.refresh();
                    }
    
                    var myTemp:String = event.currentTarget.selectedItem.file;
                    var arrayLength:Number = _secdataProvider.length;
                    var flag:Boolean = false;
                    for(var i:int = 0; i < arrayLength; i++)
                    {
                        if(_secdataProvider[i].file == myTemp)
                            flag = true;
                    }
                    if (flag == true){
                        Alert.show("already selected");
                    }else{
                        Alert.show("this can be added");
                        _secdataProvider.addItem(event.currentTarget.selectedItem);
                        _secdataProvider.refresh();
                    }
                }
    

    Rgds

    Johnny

  • Parameter include in the layout, false if the value of an element in a collection of table is empty

    For the moment, I have a collection of table which is filled by an http request to a remote xml file. One of the fields he gets from this xml file is "productoptiona", which, in the application fills the text field of a radio button. What I want is this radio button does not appear in the application, IF the productoptiona field is not any text inside in the collection/xml table that is the product of the selected file is not an option a. Name of my collection of table from the file xml is 'productsAC' and 'choicesTilelist' is the tilelist filled by this collection of table which users will use to select products from.

    I applied the following code to the property inludeInLayout of the option button and I can't for the life of understand me why he is not doing anything.

    includeInLayout = {} «»

    choicesTilelist.selectedItem.productoptiona! == ''}"

    This code I can say should mean that the selected product productoptiona is NOT empty, then it should be included in the app, but if it is empty, but when I run the app this option button is included in the application, whether or not the productoptiona field is empty, it should be excluded.

    Even if you do includeInLayout = false, the component will always be visible

    on the stage. You must make the visible = false also.

    Let me know if this helped you

  • The Source of an Image to link to the Icon of a Collection of table property

    Is it possible to do what I can't seem to make it work? For example, the image is called myImage and I need my collections of table icon to change in change source myImage. I tried this but it does not work: -.

    {id:}

    "First element" , label: "First element" , icon: "{myImage.source}" },

    Can someone help me on this? Thanks for your suggestions.

    Try this out. Julst is a start. This will save your image to disk. Yes, you can replace the existing images.

    You want to save the images on the spot I guess?

    Dany


    <>
    xmlns:MX ="http://www.adobe.com/2006/mxml" layout = "absolute" verticalAlign = "middle" backgroundColor = "white" width = "1024" height = "768" > "


        Import mx.graphics.codec.JPEGEncoder;
       
    Import mx.graphics.ImageSnapshot;
    Import mx.collections. *;
       
    private void takeSnapshot(event:Event): void
    {
    capture the image
    var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData (myhtml);
    create a bitmap
    var s:Object = new Bitmap (imageBitmapData);
           
    Encode to JPEG
    var jpgEncoder:JPEGEncoder = new JPEGEncoder (60);
    var ba: ByteArray = jpgEncoder.encode (imageBitmapData);

    Choose a file name, you can do it dynamically according to the event
           
    var filename:String = "MyImage"
    resolve the path to a file object
    var file:File = File.applicationDirectory.resolvePath (filename);

    get the native path
    var wr:File = new queue (file.nativePath);
           
    create a filestream
    var stream: FileStream = new FileStream();
           
    open/create file, set the filemode to write in order to save.
    Stream.Open (wr, FileMode.WRITE);
           
    write your byteArray in the file.
    stream.writeBytes (ba, 0, ba.length);
           
    Close the file.
    Stream.Close ();

    Switch (MYHTML. Rental)
    {
    case "http://abcnews.go.com/":
    abcnewsimage.source = filename;
                   
    break;
           
    case "http://news.bbc.co.uk/":
    bbcnewsimage.source = filename;
    break;
    }
           
           
    }
       
       
       
    private var myTilelistAArrayCollection:ArrayCollection = new ArrayCollection () collection
    [{id: "ABC News Item", label: "ABC News" ", icon: ' '},]
    ([{id: "BBC News Item", label: "BBC News" ", icon: ' '}]) ;
       
    private var myTilelistBArrayCollection:ArrayCollection = new ArrayCollection([)
    {id: "ABC News Item", label: "ABC News" ", icon: ' '},
    ([{id: "BBC News Item", label: "BBC News" ", icon: ' '}]) ;
       
    ]]>
       
       
       
       
       
       
           
           
       

       
       
        http://abcnews.com/"complete =" takeSnapshot (event) "width ="250"height ="250"horizontalScrollPolicy ="off"verticalScrollPolicy ="off"x ="10"y ="118"/ >"
       

       
       

  • Newbie: why can I not use a collection of table to feed a line chart series

    Unfortunately, I have a simple wish, but I'm spending hours trying to get this to work flex.

    1. take a collection of table

    2. Enter the data in a chart.

    To bind the data to the table... I tried all kinds of combinations of "@date" or data.date or {date}... etc...

    Below, works now... why?  (Note, when I self an XMLListcollection and @close for data binding, it seems to work)

    I'm at the beginning of the career of 'flex' and must admit that it is difficult with the lack of detailed examples, so hopeful of inspiration.

    < mx:ArrayCollection id = "2" >
    < mx:source >
    < mx:Object date = open '8' = '40,38' close = "40.81" / >
    < mx:Object date = '9' open = "40.5" close = "40,41" / >
    < mx:Object date = "10" open = '40,82' close = "40.6" / >
    < / mx:source >
    < / mx:ArrayCollection >

    < mx:Panel title = 'LineChart and AreaChart control 3.
    = "84" height = "491" width = "729" layout = "horizontal" x = "350" >
    < mx:LineChart id = 'linechart' height = '100% ' width = '100% '.
    paddingLeft = "5" = "5" paddingRight
    showDataTips = "true" dataProvider = "{2}" >
    < mx:horizontalAxis >
    < mx:CategoryAxis id = categoryField = "{data.date 'ca'}" title = "Date" / > "
    < / mx:horizontalAxis >
    < mx:series >
    < mx:LineSeries yField = "{data.close}" form = "curve" displayName = "Profit" lineStroke = "{s1}" / > ""
    < / mx:series >
    < / mx:LineChart >
    < mx:Legend dataProvider = "{linechart}" / >
    < / mx:Panel >

    Try categoryField = "date" and yField = "close" with no braces.

  • date of sorting in the collection of table field

    How can I sort on a date field in a collection of table?
    for reference, this is the date format: "Fri 01 Dec 09:47:43 GMT - 07:00 2006.
    Any idea?

    Thanks for the idea,
    It worked!

    Once again thank you! Babo_Ya for your constant help & support!

  • How to copy a Collection of table without incurring a new to the former?

    I created a table of a WebService results Collection. Some later in the code, I created a copy of this Collection of table, in order to apply a filter. However, when I make a change to the new table Collection, it updates the Collection of original painting.

    How can I avoid this? I want the new table Collection it's own entity that I can update on the fly without affecting the original Collection.

    Since this forum does not have an "Attach Code" option, here is a small sample of my code:


    private var aColl1:ArrayCollection;
    private var aColl2:ArrayCollection;

    ....

    WebService result Manager

    aColl1 = ws.lastResult as ArrayCollection collection;

    ....

    Another function in the same Application

    aColl2 = new ArrayCollection (aColl1.toArray ());

    aColl2.filterFunction = myFilter;

    aColl2.refresh ();

    ....

    A third function in the same Application

    for each (var item: object in aColl2)
    {
    object [property] = "newValue"; This updates the same object in the Collection of original painting
    }

    Hi Eric,.

    Similar to Java, AS all objects are references. Then, even when you copy a table new table elements would refer to the same objects.

    What you need is a good copy of the object. You can try using ObjectUtil.copy for each element of the array and create a new table and use it.

    -Sultani
    http://flexpearls.blogspot.com

  • the collection of table support

    Hi, I'm trying to create a slideshow with the RSS feeds from flickr. I use a component datagrid to store the images (because of the effects of transition when I add or remove an item from the dataProvider.) I can go through the images very efficiently by simply removing the first element in the collection of table, but then I get to the end and of course the slideshow is none because I deleted everything. is there an easy way for me to just take the first object in the collection of table and move it to the end? I tried photoFeed.setItemAt (object, int); but I don't know how to call on the first object in the collection of table. also, for the int variable I try to use photoFeed.length because I want it move to the end of the array whose length should be the correct number from the beginning of indexation of array to 0.

    Although I can't understand the requirement of moving an item at the end of a slide show, you can use

    var point: Object = photoFeed.removeItemAt (0);
    photoFeed.addItem (item);

    to achieve what you want.

    If you just want to browse the pictures one by one until the end, you just need to use the createCursor API and get a cursor. By calling moveNext on the slider, you move through the collection until moveNext returns false.

  • Table Collection &amp; quot; get question to &amp; quot; question

    I have an application with a picture of the collection, here's the elements of fist 2:

    [Bindable]
    private var ingredientList:ArrayCollection = new ArrayCollection([)
    {label: "Celery, chopped", max: 2, def:1, min:1, units: "cups"},
    ([{label: "Onions, chopped", max: 3, def:1, min:2, units: "cups"}]) ;

    I'm making reference to these elements in form controls, as in:

    < mx:FormItem >
    < mx:HBox >
    < mx:CheckBox id = 'c0' width = "{draped}" label = "{ingredientList [0] .label}" change = "enableStepper (q0, c0)" selected = "false" / > "
    < mx:NumericStepper id = "q0" width = "{nsW}" minimum = "{ingredientList [0] .revolutions} ' maximum stepSize =" {.max ingredientList [0]} "=".5"enabled ="false"/ >
    < mx:Label text = "{.units ingredientList [0]}" / >
    < / mx:HBox >
    < / mx:FormItem >

    Now, it seems to work, but the compiler 'complained' (yellow icon) me has access to members of the table with the support rating, saying I should "use ArrayCollecyion.getItemAt ().

    Why and how it works, exactly? How would re - write my code to use the preferred method?

    Thank you.

    just replace [0] getItemAt (0) and leave all the rest the same.

  • Collection of table problem

    I have a combobox that I would be filled with the values of an array that is selected in a switch statement. The problem I have is that the only thing I can get display the name of the function of the switch. ComboBox in question is in the State called "Step 2" and I want it be filled with one of the ArrayCollections in the getTool() function based on the selection of the first cbxServCen of the comboBox displays.

    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" backgroundGradientAlphas = "[1.0, 1.0]" backgroundGradientColors = "[#3F3D3D, #3F3D3D]" >
    < mx: states >
    < name mx: State = 'Step 2' >
    < mx:AddChild = "{frmChartConfig}" position relativeTo = "lastChild" >
    < mx:FormItem label = "Tool" >
    < mx:ComboBox id = "cbxTool" dataProvider = "getTool (cbxServCen.label)" / > "
    < / mx:FormItem >
    < / mx:AddChild >
    < / mx: State >
    < / mx: states >
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;

    public var toolList: ArrayCollection collection;
    [Bindable]
    public var servCen:ArrayCollection = new ArrayCollection () collection
    ([{label: "EAEC", data: 1}, {label: "MCAE", data: 2}, {label: "SSCAE", data: 3}]);

    public void getTool(tool:String):ArrayCollection {}
    {Switch (Tool)}
    case 'EAEC ':
    var toolList: collection ArrayCollection = new ArrayCollection () collection
    ([{label: "Actel", data: 701}, {label: "Agilent", data: 702}, {label: "Ansoft', data: 703},]) ;
    break;
    case "MCAE":
    var toolList: collection ArrayCollection = new ArrayCollection () collection
    ([{label: 'Femap', data: 501}, {label: "NX (Des.) ', data: 502}, {label:"NX (Mfg)", data: 503},]) ;
    break;
    case 'SSCAE ':
    var toolList: collection ArrayCollection = new ArrayCollection () collection
    ([{label: "STK", data: 101}, {label: "Windriver", data: 102}, {label: "Telelogic', data: 03},]) ;
    break;
    }
    Return toolList;
    }

    []] >
    < / mx:Script >

    < text mx:Text = "Using CAE Center" textAlign = "center" fontSize = "26" fontWeight = "bold" fontFamily = "Georgia" color = "#FDFEFE" width = "1197" / >
    < mx:Form "315" = x y = "292" width = "485" backgroundColor = "#032697" backgroundAlpha = "0.18" height = '152' id = 'frmChartConfig' color = "#FCFEFE" fontSize = "17" fontWeight = "bold" >
    < mx:Label text = "Select a Service Center" / >
    < mx:FormItem >
    < mx:ComboBox id = "cbxServCen" dataProvider = "{servCen}" enabled = "true" editable = "false" color = "#0E0D0D" fontSize = "12" change = "currentState = ' step 2 '" / >
    < / mx:FormItem >
    < / mx:Form >

    < / mx:Application >


    "spacehog" wrote in message
    News:gen7aj$gve$1@forums. Macromedia.com...
    > I have a combobox that I would be filled with the values of a
    > table
    > It is chosen a switch statement. The problem I have is that
    > the
    > the only thing I can get to display the name of the function of the switch. The
    > comboBox in question is in the State called "Step 2" and I want it to be
    > filled with one of the ArrayCollections in the function getTool() according to
    > on
    > the selection of the first comboBox cbxServCen posted.
    >
    ' > http://www.adobe.com/2006/mxml '.
    > layout = "absolute".
    > backgroundGradientAlphas = "[1.0, 1.0]" backgroundGradientColors = "[#3F3D3D,]".
    "[> #3F3D3D]" >
    >
    >
    >
    >
    >

    Oops. Press send too early. cbxServCen is not a label. You probably
    want to watch its value, anyway.

  • The queue from table question

    I had a recent application where I wanted to take 100 samples of something then get the RMS of the dara. This is happening in a loop, and until the end of the program. Very basic stuff.

    • Method of the QUEUE:
    • Get queues with max 100 items.
    • Queue data (data arrive on every 50mS).
    • Get the status of the queue when the number of items is 100...
    • ... Empty the queue and get all the items (which of course will be a prison guard) and use the RMS funtion.
    • Repeat

    ---------------------

    • TABLE method:
    • Initialize the array with 100 elements of the DBL 9999.99 (it is a value that can only happen in the data)
    • Insert data in the table to help replace a subset of table
    • When 100 index isn't 9999.99, then...
    • ... Put the table in the RMS function, then re - initialize the full array of the 9999.99
    • Repeat

    My questions are, who should be faster, including better management of memory?

    Thank you!

    Why not just use the RMS PtByPt VI. In this way, you don't need to store data at all? This may require that marginally more calculation, but will require less memory.

    If you insist on the pad, I'd probably go with the table for simplicity. I think you can simplify your system to determine when to treat well. No reason to have all these 9999.99 is here.

    Chris

  • Ring of table question

    Hello

    I'm using LabWindows/CVI 8.5 and I have a question about the use of the rings in a table cell.  I have a table that has 10 columns, and the columns are a mixture of numerical values, chains and rings - that is to say 2 columns are rings.

    The table is filled by the program (initially it will be empty).  Each of the ring cells is supposed to contain 30 values.  I've noticed that I fill the table with data in different columns, all works well - rings unless.  After filling the table, cells of the ring show only the first element that was written on the ring.  Also, when I click on the arrow to display other values in the ring, nothing is happening, i.e. There is no action to drop down at all in the ring.

    I walked through the loop in the code that makes the call to InsertTableCellRingItem to insert every element in the ring, and everything seems to work.  Return the statutes by the calls of the insert are always 0.  I also watched the TableCells example in L/CVI 8.5 and I see no real difference in the example, in what I do.

    For me, it sounds like a setting somewhere, but I was unable to understand what could be this setting.

    Any ideas?

    Harv

    OK... Sorry about losing someone there is time on it.  I kept playing around and found the answer.

    The global settings for the table, it was in mode 'Column', but he was not in "Hot" mode  Once I did 'Hot', the rings started working as expected.

    Thanks for listening!

    Harv

  • Hyperion Planning Alias table question

    Hi all

    We have a problem with the Alias of Hyperion planning table.

    For example: the country Brazil has Portuguese as official language, but the table Alias must be BRL_Alias.When we tried to name, the name of the Alias as BRL_Alias it takes the Portuguese characters such as question marks (?).
    Could you please let us know how this can be resolved.

    Thank you

    Hello

    you have created your application in unicode mode?

    You can check in the library of the application-> tools-> manage the Source of data for planning. Select your data source and see if the "Unicode support" is true

    Kind regards

    Ilias

Maybe you are looking for

  • How to eject the disc from the drive superdrive usb?

    How to eject the disc from the drive superdrive usb?

  • Windows starts with a blank screen and a functional mouse cursor

    Recently my HP laptop turned off by itself, when I resarted, I got was a white screen with a functional mouse cursor. There is no logon screen or anything just a blank screen. When I'm in safe mode then it will display "safe mode", written in the fou

  • BlackBerry smartphones my 9800 uninstalls random apps

    Does anyone have this problem?  My 9800 att works very well and I really like the use of this but the boring look of the phone is that it randomly uninstall my applications.  Today, the gift of Blackberry, DriveSafe.ly Enterprise edition software uni

  • HP 6500 E907n go turns off

    Hi, mi printer does not work, I power on the printer a square go left right after 2 time, turn on the simbol of exclamation and the place of the judgment of the LCD screen, then the printer turns off automatically. I removed the print head for cleani

  • Media offline Media Encoder

    After this first update, I'm making a video through the SOUL, but everything except the audio is online now. And I can't go to work. And all files work perfectly im first.Windows 10AMD Radeon R7 M260