Adding property/field to an item inside array collection

Hi
I'm newbie. But I'm spending a huge amout of time trying to figure out something that should be simple.
in short:
I wanted to add a new field/property to an item inside an arraycollection(ac).
I thought something like:
ac.souce[i].push(object:value)
would do (its inside a loop, since I have ac.length) but it didnt.
ITS IMPORTANT TO SAY THAT:
i think addItem, or addItemAt IS NOT THE CASE.
I want to add an new item INSIDE the array that is wrapped in ac.
in long:
I have a ORDERS table that comes with a client_id (int).
I need to retrieve the client's name from a CLIENTS table.
Ok i have to put everything on the same datagrid. So, first i've tried to ivoke a function like this that would use the getClientsByID and return a string with its name.
It didn't worked, maybe due to the syntax.
SO, i thought i had to put all those 2 tables into 1 array collection to use this as a 'formated' data provider for the datagrid.
What should I do? this is a simples example.
Thanks a lot
Btp~

Just borrow code from ListBase.as, don't actually use an instance of ListBase.  That pattern should work for non-display classes as well.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • Programmatically create array from common cluster items inside array of clusters

    I have seen many questions and responses on dealing with arrays of clusters, but none that discuss quite what I am looking for. I am trying to programmatically create an array from common cluster items inside array of clusters. I have a working solution but looking for a cleaner approach.  I have an array of clusters representing channels of data.  Each cluster contains a mixture of control data types, i.e.. names, types, range, values, units, etc. The entire cluster is a typedef made up of other typedefs such as the type, range and units and native controls like numeric and boolean. One array is a “block” or module. One cluster is a channel of data. I wrote a small vi to extract all the data with the same units and “pipe” them into another array so that I can process all the data from all the channels of the same units together.  It consists of a loop to iterate through the array, in which there is an unbundle by name and a case structure with a case for each unit.  Within a specific case, there is a build array for that unit and all the other non-relevant shift registers pass through.  As you can see from the attached snapshots, the effort to add an additional unit grows as each non-relevant case must be wired through.  It is important to note that there is no default case.  My question:  Is there a cleaner, more efficient and elegant way to do this?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    NI_Chan units to array_1.png ‏35 KB
    NI_Chan units to array_2.png ‏50 KB

    nathand wrote:
    Your comments made me curious, so I put together a quick test. Maybe there's an error in the code (below as a snippet, and attached as a VI) or maybe it's been fixed in LabVIEW 2013, but I'm consistently getting faster times from the IPE (2-3 ms versus 5-6ms for unbundle/index). See if you get the same results. For fun I flipped the order of the test and got the same results (this is why the snippet and the VI execute the tests in opposite order).
    This seems like a poster child for using the IPES!  We can look at the index array + replace subset and recognize that it is in place, but the compiler is not so clever (yet!).  The bundle/unbundle is a well-known "magic pattern" so it should be roughly equivalent to the IPES, with a tiny penalty due to overhead.
    Replace only the array operation with an IPES and leave the bundle/unbundle alone and I wager the times will be roughly the same as using the nested IPES.  Maybe even a slight lean toward the magic pattern now if I recall correctly.
    If you instantly recognize all combinations which the compiler will optimize and not optimize, or you want to exhaustively benchmark all of your code then pick and choose between the two to avoid the slight overhead.  Otherwise I think the IPES looks better, at best works MUCH better, and at worst works ever-so-slightly worse.  And as a not-so-gentle reminder to all:  if you really care about performance at this level of detail: TURN OFF DEBUGGING!

  • SRM 7.0 -Adding Custom fields in Contract Item screen at particular positn

    Hi,
    We have a requirement to add new custom fields in the Contract Item screen at required position, in Left and right side container.
    We have tried the following methods but have not been able to achieve the same. Kindly help!
    1) Added new field in Context through enhancemnt in the Details screen View of Contract , Binded the field to the field in structure INCL_EEW_PD_ITEM_CSF_CTR and add the field to teh Layout - Using this method, The field is not saved to the table.
    2) Added the field to meta data table /SAPSRM/V_MDF_IC - This is positionng the field on teh right container at the bottom. We want to position it on left side.
    Kindly help to understand where we are going wrong.
    Thanks in advance,
    Regards
    Prasuna.

    Hi Prasuna,
    Sorry ..You are right..I was looking at some other WDC related to contract data..It you map the CUFs to /SAPSRM/S_CLL_CTR_ITEM which has the include structure INCL_EEW_PD_ITEM_CSF_CTR then it should work fine.
    If you do this, are you able to view the new fields on the screen?
    you mentioned that you are not able to save the data to the table.
    Include your fields in INCL_EEW_PD_ITEM_CSF as well because if you add CUF to any of those doc types, you also have to add those CUF to the global structure for CUF documents.
    Also Check if you fields are there in structures BBPS_CTR_CUF_ITEM,BBPS_CTR_UI_ITEM and BBPS_CTR_ITEM.
    Check whether you have implemented the BADI's like BBP_DOC_CHECK_BADI ,BBP_DOC_CHANGE_BADI and BBP_DOC_SAVE_BADI . check out the structures (whether they having the CUFS) used in those if you have implemented any of them .
    Regards
    Lavanya
    Edited by: LAVANYA CHAVA on Aug 25, 2010 10:10 AM

  • Adding new field in ME21N items level NO ADDITIONAL TAB or SUBSCREEN

    Hello Gurus!!
    I have a requirement where I am just trying to add a new field ZZ*** at Item level in ME21N (and no new tabs please)
    I got the modification key and now wat i see is that in screen 1211 SAP has some field mappings with metadata.
    Refer to Include LMEMFSF0T.
    Can you please help me how sud i proceed or  wat can be an alternate way out to solve.
    regards,
    Prasenjit Singh Bist

    Hi,
         Another way of doing the same is to use screen-exits for the transaction. You can use the standard enhancement MM06E005 in SMOD for the Purchasing related custom fields. You can add the fields in the screens 0101, 0111 of program SAPLXM06 to get the fields in the tab 'Customer Data' at header level and item level for ME* transactions.
    EXIT_SAPMM06E_006 
    EXIT_SAPMM06E_007 
    EXIT_SAPMM06E_008 
                        are the function modules where u need to do the coding.
    and the fields u have added need to be included in the  includes
    CI_EKKODB
    CI_EKPODB
    of EKKO and EKPO for header level and item level respectively.
    Regards,
    Vishnu Priya
    Message was edited by:
            Vishnu priya
    Message was edited by:
            Vishnu priya

  • Adding customer field into  BID item Overview

    Good afternoon,
    (SRM 5.5)
    I have added the customer field in the BID.
    Is it possible to show it, in the "Item Overvier of BID"?
    Alexey

    Hi,
    Generally through the INCL_EEW* structures,you can add the custom fields for the Bid Item only under the BASIC DATA tab.If you want to show up a field on the Item overview screen,then this will need std code modification(screen modification) or  need to  modify the HTML template for the BID item overview screen in the ITS service BBP_QUOT which will need lot of HTML expertise.
    Hope this helps.
    BR,
    Disha.
    Do reward points for  useful answers.

  • Added new field in SC Item table but after Check/Enter the value disappears

    I have added a field in the SC Item table in view V_SC_DOTC_BASIC. Everything works perfectly well except that when a value is entered into that field and ENTER or CHECK is selected, the value goes away and the field becomes a read-only field with nothing in it.
    I know I am missing something, but what?
    All help is appreciated and rewarded.

    Thank you for your reply Masa.
    There is currently an implementation of that BADI that is in use. Brief detail on it. We added a field to the SC Item and included it in the table view for WBS Element. This will allow the users to enter the WBS Element on the item line and not have to go to the Account Assignment section.
    The BADI implementation takes whatever is entered in that field and applies it to the account assignment for that item.
    The actual value in the field is never changed. It is just used to update the account assignment.
    It is not a tabular addition, so the ET_ICF does not come into play.
    Is there anything else you can think of that would allow for the field to display its entries once the CHECK/ENTER is activated?

  • Adding Custom fields to SRM Item Data tab & Account Assignment Tab

    Hi Everyone,
    We have got a small requirement to add 2 custom fields in SRM Shopping cart.
    Need to add a input field, which should act just like Requisitioner in ECC. ( F4 help ).This will allow to create shopping cart on behalf of some one.
    Need to add input field, which resembles Goods Recipient in ECC ( Free text)
    After adding custom fields, how do i ensure that, it's mapped to right field in ECC.I spent much browsing SRM forum, but couldn't gather much information. I understood that, this involves configuration in SPRO.
    Any information or help in any kind would be really helpful.
    Thanks in advance.
    Vishnu

    Hi Vishnu,
    Take look at this link.
    Add custom field to SC and POWL
    Thanks
    Senthil

  • Adding a field to line item display in FBL3

    Hello,
    In trx "FBL3" I give asset G/l account, I would like to see "asset number", along with "Document No, Posting Keys, Posted date".I went to  "change Lay out" added asset field. But still it showing only a column with heading asset but no values in it. Is there anything to be done in
    trx "O7Z3", "O7R3" and then in "O7V2" assign FBL3 to the newly  defined line layout and total variant. Is this correct way of  proceeding  or anything else needs to be done.
    Can can any one suggest what needs to be done.
    Thanks in advance,
    Regards,
    Anil

    hi Anil,
    i think that's not possible with fbl3.
    the asset no. is only assigned to the reconciliation accounts by posting purchase/retirement/depr.
    and not on other accounts - the reconciliation account
    are normally not displayed with fbl3 - therefore are transactions from FI-AA (AW01N)
    Andreas

  • Adding new field in ME51n Item overview

    Hi all,
              i have a requirment to add a new field in me51n item overview, there i have a tab material data, in that i have to add a new field called Warranty. can any one  kindly guide me the steps to do this.
    thanks,
    nagaraj.

    Hi,
    Implement this enhancement MEREQ001 in CMOD. Before implementing read its documentation which will guide you steps for implementation. for more help use the below link.
    Link: http://www.sdn.sap.com/irj/scn/advancedsearch?query=mereq001
    Regards
    Ahsan

  • Removing Items From Array Collection

    Hi. I have an array collection which is made up of items
    defined in class PlayListEntry. I want to remove all the items that
    have the value of property select set to false. This is what i have
    come up with, it works fine, but only removes half the items at a
    time. I think this is because when you remove and item with
    removeitemat() it shifts the index of the items. How can i get
    around this?
    Code
    private function removeitems():void{
    for each (var ple:PlayListEntry in songCollection){
    if (ple["select"] != true){
    songCollection.removeItemAt(songCollection.getItemIndex(ple));
    }

    Here's a sample application I wrote that achieves what you're
    looking for.
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable] private var medalsAC:ArrayCollection = new
    ArrayCollection([
    {Country:"USA", Gold:35, Silver:39, Bronze:29, select:true},
    {Country:"China", Gold:32, Silver:17, Bronze:14,
    select:true},
    {Country:"Russia", Gold:27, Silver:27, Bronze:38,
    select:true},
    {Country:"USA2", Gold:35, Silver:39, Bronze:29,
    select:false},
    {Country:"China2", Gold:32, Silver:17, Bronze:14,
    select:false},
    {Country:"Russia2", Gold:27, Silver:27, Bronze:38,
    select:false},
    {Country:"USA3", Gold:35, Silver:39, Bronze:29,
    select:true},
    {Country:"China3", Gold:32, Silver:17, Bronze:14,
    select:true},
    {Country:"Russia3", Gold:27, Silver:27, Bronze:38,
    select:true}
    private function filterItems():void {
    for(var i:Number = 0; i < medalsAC.length; i++){
    if(medalsAC
    .select == false){
    // => Remove item
    medalsAC.removeItemAt(i);
    // => Refresh collection so it see's new change.
    medalsAC.refresh();
    // => Start at beginning and keep looking
    i = 0;
    ]]>
    </mx:Script>
    <mx:Button x="10" y="10" label="Remove False Items"
    click="filterItems()"/>
    <mx:DataGrid left="10" right="10" top="35" bottom="10"
    dataProvider="{medalsAC}">
    <mx:columns>
    <mx:DataGridColumn headerText="Country"
    dataField="Country"/>
    <mx:DataGridColumn headerText="Gold"
    dataField="Gold"/>
    <mx:DataGridColumn headerText="Silver"
    dataField="Silver"/>
    <mx:DataGridColumn headerText="Bronze"
    dataField="Bronze"/>
    <mx:DataGridColumn headerText="Select"
    dataField="select"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>

  • Document ID - Property field shows on item view property page after deactivating the Document ID Service features at Site Collection level

    Hi,
    When a site collection was created, I enabled the Document ID feature at site collection level.  Then some item was created in a document library as well as list libarary
    Now it was decided that we dont want the Document ID feature so I disable the feature from Collection feature list
    Still when a user view the property of a document it shows the Document ID property with the ID (when click on the ID it shows the message that 
    This Site Collection is not configured to use Document IDs.
    Troubleshoot
    issues with Microsoft SharePoint Foundation.
    Correlation ID: 9640ac9f-4b9c-4ae8-9f0b-402ed7e3b3c5)     Is there anything that I should do so that DOcument ID property does not show on the document property page... I tried
    to looked at the content type to see if I can remove the document ID but I could not find the Document ID as a property that can be removed from the type

     
    Hi,
    I would just remove the column from the view.  You can make views for each list, it you look under the list by Clicking List while the list is open, you should see a link in the ribbon which say "Modify view" click this link. 
    This link will open the edit view page you can then uncheck the box for the column which will remove it form that view.
    According to this
    http://msdn.microsoft.com/en-us/library/ee559302.aspx
    Deactivating the feature removes links to the Site Collection Settings page, makes the page that is used to look up document IDs no longer available, turns off the document ID service, and stops assigning document IDs. The server does not remove the columns
    that it adds at the site level when the feature is first activated so that, even after deactivation, the existing document IDs are preserved. After the feature is deactivated, users who try to use a static URL to look up an item by its document ID see an error
    message indicating that "This Site Collection is not configured to use document IDs."
    The Document id service will add new columns to the document content type and the document set content type. 
    It also adds an event receiver which should be deactivated when you deactivate the doc id service. 
    Theoretically.  You should be able to go in and remove the columns from the document type, and then force an update.
    Thanks,
    Rock Wang
    Rock Wang TechNet Community Support

  • Adding custom fields on SC item level

    Hi All,
    I appended 3 customer fields in structure INCL_EEW_PD_ITEM_CSF_SC.
    Shall i append those three fields in structure INCL_EEW_PD_ITEM_CSF ?
    Will it create subscreen automatically in SRM7.0?
    Please give me any suggesstion.
    Regardsm
    Oorvi

    Hello Oorvi.
    Look at blog below:
    [How to create custom fields in SRM|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID2069457250DB00157537042540212035End?blog=/pub/wlg/4711]
    Customer fields are added automatically to standard dynpro using dedicated subscreen.
    Now, with all answers which were given to you on all threads you opened, you should be able to work by yourself.
    Regards.
    Laurent.

  • Adding Additional fields to DirectoryEntry items

    Is it possible to add additional fields to a DirectoryEntry item when creating a custom directory?
    I've got a custom directory working currently and now I want to add another field (Cellphone) to the directory.
    Here's what the xml would look like:
    <CiscoIPPhoneDirectory>
    <Title>My Test Directory</Title>
    <Prompt>Just Testing</Prompt>
    <DirectoryEntry>
    <Name>Johnson, Darren</Name>
    <Telephone>8110</Telephone>
    <Cellphone>7012616557</Cellphone>
    </DirectoryEntry>
    <DirectoryEntry>
    <Name>Johnson, Darrell</Name>
    <Telephone>8648</Telephone>
    <Cellphone>7012616557</Cellphone>
    </DirectoryEntry>
    </CiscoIPPhoneDirectory>
    This works in IE but throws an "XML Error [4]: Parse Error" exception on the phone.
    What I'd like to do is create a 4th SoftKey at the bottom of the page for "CellPhone".
    Thanks

    You can't extend the language that the phone understands... it can handle what's in the schema and that's that. However, if you look into the schema, you'll see that a CiscoIPphoneDirectory may have up to 8 softkeys:
    Thus, you can add your own softkeys the usual way
    Displayed sofkey label
    URL or URI action for softkey RELEASE event
    URL or URI action for softkey PRESS event
    position of softkey
    Of course, if you add your own softkeys, you're going to lose the ones that are normally there so you have to replicate those as well (so the first one would have the URL "Dial:8110", the second one "EditDial:8110", the third one "Key:Services" and the one you want to label cellphone (obviously the key doesn't have so much space so you might just call it "cell", would use the URL "Dial:7012616557" (all those URLs are in relation to the first directory entry you posted).
    Come to think of it, I suspect that a CiscoIPPhoneDirectory isn't really what you are looking for, since that element offers no means of triggering a different action for whatever item has been selected whereas a CiscoIPPhoneMenu allows you to have an URL per menu Item plus an url suffix per button so you can do all that you need to do in this case.

  • Adding text field to SC item Dynpro

    Hi Experts,
    I need to add new text field on SC Dynpro for standard field "product type". In standard it has two value : "01" or "02". And I nedd to add near "Material" or "Service". I checked standard field in F4.
    It's info about field:
    General Information About the Application and Component
    Application:     /SAPSRM/WDA_L_FPM_OIF
    Web Dynpro Component:     /SAPSRM/WDC_DODC_SC_I_BD
    Window Information:     IV_L_FPC_CA_DETAILS
    View Information:     V_DODC_SC_I_BD
    Configuration ID:     /SAPSRM/WDCC_FPM_DODC_SC_I_BD_PR
    Information on Field
    Field ID:     ZZI_PRODUCT_TYPE_ATTR
    Type of UI Element:     INPUT_FIELD
    UI Element Library:     STANDARD
    But when I go to Component /SAPSRM/WDC_DODC_SC_I_BD I can't found this field. I think this field as dynamic field created.
    Also question: How I can call this field (for example in method modifyview) and add new field on the right side?
    Thanks in Advance.
    Evgeniy

    Hi Evgeny 
    I dint understand your question , I am able to see componet /SAPSRM/WDC_DODC_SC_I_BD and view V_DODC_SC_I_BD .
    you can create enhancement for this view and can add your field here.

  • Adding new fields to Item Data - PO (ME

    Hi All,
    Is it possible to add new custom fields to PO Item Data in Confirmations tab and these new fields are required only in PO Change (ME22N).
    How can we achieve this!
    Can anybody provide feasible solution for the same!
    can anybody tell me if this is possible!
    Thanks in advance.
    Thanks,
    Deep.

    Hi All,
    Thanks for the reply.
    Can anybody confirm BADI ME_GUI_PO_CUST will acheive desired functionality for above posted issue!
    Functionality: Adding new custom fields to confirmation tab. During Inbound delivery in confirmation tab (Item data) if 'Confirmation category' is selected then the new custom fields should show up below for input & they can be saved.
    if 'Confirmation category' is not selected then new custom fields should be invisible.
    Thanks,
    Deep.
    Edited by: Deep on Jul 24, 2009 4:49 AM
    Edited by: Deep on Jul 24, 2009 5:05 AM

Maybe you are looking for

  • Photoshop CS4 crashes on Mac Pro – log mention "ATIRadeonX1000GLDriver" etc.

    Hi! Since switching from Photoshop CS3 to Photoshop CS4 one users here at work started to get stability problems. He said it happens mostly when "painting" layer masks. Mac Pro (first generation) 2.66 GHz Mac OS X 10.5.6 5 GB RAM Photoshop CS4 Standa

  • Insert image into table

    Please let me know how to insert images to table using SQLDeveloper?

  • Contacts/ Yahoo account duplicating

    Hi, So my problem is that when trying to sync all my contacts (2 yahoo addresses, and an Icloud), only 1 of my yahoo accounts duplicates my contacts- heres the catch though- when checking my actual yahoo account online, there are no duplicates, & whe

  • Installing XE on MacBook Pro

    I would like to install Oracle 10g XE on a MacBook Pro dual boot using BootCamp and is running Windows Vista Home Premium. I also have Weblogic 10.3.0.0 running on this box as well. XE seems to have installed correctly. I configured the dataSource in

  • Time Magazine app:  "unknown error"

    Won't let me sign in.  Deleting and redownloading app didn't help.  Any ideas?  Would resetting the device help?  Thanks in advance.