How to add a new column to an existing item to an arraycollection collection?

Hello

I have a collection of arraycollection, acLeaseContract, which has this structure:

Capture.JPG

These are the columns and their respective data I get from main system. Now, I would like to add 2 more columns, after TenantName.

I can iterate through this collection arraycollection, creating an object, add all columns again to the new object, and also add new columns that I want to add and then add that object to the arraycollection collection.

for (i = 0; i < acLeaseContract.length; i ++) {}

var o: Object = new Object();

o.ContNo = acLeaseContract [i]. ContNo;

o.ContType = acLeaseContract [i]. ContType;

o.EndDt = acLeaseContract [i]. EndDt;

.

.

.

.

o.TenantName = acLeaseContract [i]. TenantName;

o.MyNewColumn1 = "somevalue";

o.MyNewColumn2 = "somevalue";

acLeaseContract.addItemAt (o, i);

}

But I think it's very painful and long, because we re building the collection whole arraycollection once again, just to add a couple of more columns.

Is there a clever way to update the collection arraycollection with new entries, if yes can you pls tell me how can this be achieved?

Thanks for your help...

-Deepak

Hello Deepak,

Try to use the ObjectUtil.copy method. This will create a complete copy of your object as:

var tempArray:Array = ObjectUtil.copy (acLeaseContract.source) in the table;

acLeaseContract = new ArrayCollection (tempArray);

You will avoid your iteration for simply copy your arrayCollection collection deeply.

Now, when you look at acLeaseContract it will all contain the dataStructure as an object. Now, you are free to add any number of column to any node.

Hope this helps you.

See you soon

-Vikash

Tags: Flex

Similar Questions

  • How to add the new column in existing table to our desired location?

    How to add the new column in existing table to our desired location?

    For example, I have to add the new column 'course' before the salary column in the emp table.

    I think the best way is to add the column at the end of the table and create a new view with the order of the columns...

    Another option...

    places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table

    Refer

    Add column (from table) in the desired position

    Example:

    CREATE TABLE temp_my_user LIKE)

    SELECT * FROM password);

    DROP TABLE password;

    (Password) CREATE TABLE

    userID NUMBER

    , first name VARCAHR2 (25)

    , middleInitial VARCHAR2 (1)

    (, name VARCHAR2 (25));

    INSERT INTO password (userID, firstName, lastName)

    (SELECT username

    first name

    lastName

    OF temp_my_user);

    DROP TABLE temp_user;

  • How to add the new column in the tabular layout editor in Oracle Forms

    Hello

    I need to add the new column to a datablock and display the newly added column in the form. What are the steps I need to follow.

    1. I chose the new column from the view to the datablock.
    2. Add the text element in the layout editor. But this position is not correct. It overlaps with another column. How to add the new column to the layout editor?

    Thank you
    HC

    In the layout editor, you can simply drag the fields so that they do not overlap.
    See http://www.youtube.com/watch?v=7emNa7THMLg

    Sandeep Gandhi

  • How to add the new column to a specific position

    Hello

    My table looks like Fallows.

    Select * from company

    PRODUCT_ID COMPANY_ID COMPANY_SHORT_NAME COMPANY_LONG_NAME
    11001An Inc.Long name A Inc.
    11002B Inc.Long name B Inc.
    11003C Inc.Long name C Inc.
    21004D Inc.Long name D Inc.
    21005E Inc.Long name E Inc.
    21006F Inc.Long name F Inc.

    My requirement is I would LIKE to add A NEW COLUMN AS COMPANY_LOCATION NEXT TO COMPANY_SHORT_NAME

    How to get there.


    I tried like Fallows alter company table add company_location varchar2 (100) after company_short_name;

    but this query shows the error

    ORA-01735: invalid option of ALTER TABLE

    If the query I've tried is correct?

    Give me your suggestions.

    Thanks in advance.

    As long as you're on 11 GR 2 or lower, it will not work.

    There is no Clause "AFTER"in the alter table do not add column."

    You have the chance to use dbms_redefinition (when no interruption of service is possible) or manually create a new table with the columns in the order you need and then migrate the data and then drop the original and rename a new.

    In case you are already on 12 c, you have a chance to add the column to the end and then make visible columns and invisible status in the right order. This way your column will get to the position that you want it to be.

    Kind regards

    Carsten

  • SQL query on how to add a new column to display the result

    Select emp_code, < new column = 0 >
    from employee_table where < < condition > >

    syntax to add the new column?

    Published by: user9027633 on March 4, 2010 02:53

    user9027633 wrote:
    Select emp_code,
    from employee_table where >

    syntax to add the new column?

    Published by: user9027633 on March 4, 2010 02:53

    Want you like this

    selec emp_code, 0 new_column
      from employee_table
    
  • How to add a report column to an existing page?

    Hello friends of the Apex,

    On a page "Form on a table with report" created with the wizard, I want to add a new column to the report in the underlying table (this is the page of several row). If I try to add the name of the column in the query, Apex says:

    "You have asked to change the interactive report query. If you have added the column to the query, they will not display when the report is run. You should not use the menu actions and select columns or click Reset. If you have removed all the columns in the query, it will disable existing filters, highlight of rules and other report parameters that references the columns. Please confirm your request. »

    Of course, I don't want to not start over and re - build the page, where the hell is so this menu "actions"?

    I'm under Apex 4.1.

    Thank you very much
    Kim

    Hi Kim2012,

    Run your page and then on your report interactive, there are the search at the top of your report bar, there is a drop down menu Actions . Go to Actions-> Select columns.

    Select column has two pane .one is not displayed again are set out in the report.

    Newly added columns do not display the component, please move this column to the other side that is in view in the report pane.

    For more information on interactive reports, see the bottom of doc
    http://www.Oracle.com/technetwork/developer-tools/Apex/application-express/IRRs-083031.html

    Hope this helps you.

    Kind regards
    Jitendra

  • Add a new column before an existing column in 10g.

    Hi all

    I want add columns in a table, in front of an existing column in the database to Oracle 10G.

    Table A:
    Identification number,
    name varchar,
    Use varchar,
    ship of State.

    I want to add a column before 'JOB '.

    THAT IS TO SAY) OR AFTER USING BACK AND ALTER TABLE SYNTAX.

    Hello

    Dose of Oracle does not support this
    http://www.orafaq.com/FAQ/how_does_one_add_a_column_to_the_middle_of_a_table

  • With CVI SQL Toolkit, how to add the new variable param column in a table.

    Dear all:

    I used the CVI Sql toolkit to create a database, but now I don't know how to add a new column to a table in variable param.

    I know, to add a column with the name of constant column could be down by below:

    DBImmediateSQL ((hdbc, "alter table table1 add column1 char [100]");

    But if Column1 is a param variablae how can I write the code? Please advise?  It will be appreciated if you could give me an example.

    Best regards!

    HI -.

    If you look at the parameters that you pass to the SQL function, you can see that the second parameter is a string constant. In your code, you can create an array of characters (string). You can then use sprintf to programmatically determine what will be the contents of this variable. In the function call, you can put the variable instead of the literal string, and you will have a customizable SQL statement.

    Hope this helps-

    John M

  • Can we add a new column to a UNIQUE INDEX with out droping the same index?

    Can one please let me know how to add a new column to the UNIQUE INDEX existing on the same fall.
    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    Thank you.
    Mahi.

    TechMahi.com wrote:
    Can one please let me know how to add a new column to the UNIQUE INDEX existing on the same fall.
    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    Thank you.
    Mahi.

    I think that its doable and I don't think that it should be feasible to all too since that would disrupt the structure of index completely. I think, you must delete the existing one to add a new column that is do a composite index.

    Aman...

  • Please let me know how I can add a new column with a constraint not null, table already has data, without falling off the table... Please help me on this issue...

    Hello

    I have an emp_job_det with a, b, c columns table. Note that this TABLE ALREADY has DATA OF THESE COLUMNS

    IAM now add a new column "D" with forced not null

    Fistly I alter the table by adding the single column "D", if I do, the entire column would be created with alll of nulls for the column DEFAULT D

    ALTER table emp_job_det Add number D; -do note not null CONSTRAINT is not added

    Second... If I try to add the constraint not null, get an eoor as already conatained null values...

    (GOLD)

    In other words, if I put the query

    ALTER table emp_job_det Add number D NOT NULL; -THROWS ERROR AS TABLE ALREADY CONTAINS DATA

    So my question is how how can I add a new column with a constraint not null, table already has the data, without falling off the table

    Please help me on this issue...

    Add the column without constraint, then fill the column. Once all the rows in the table are given in the new column, and then add the constraint not null.

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • Add a new column and update of records

    I have the DW (OBAW) loaded at full load. Everything works fine.

    Now, I add a new column in a dimension in the DW (and in the ETL, RPD, CAD, etc.).

    I know that new (incremental) charges will take care of this column for the new/changed records... but

    Question is how can I update records, already loaded into PS for values in this column...?

    (a) I guess I can do this particular task of this dimension marked as 'full' DAC

    I'm not sure it's a good solution... I guess new ROW_WIDs will be generated and I have the connection with the fact table will be broken... Right?

    (b) I could blank the date of updating for this table W_ and/or refresher for this table S_ (from Siebel)

    I guess this could affect more than one task... or in other words all tasks dealing with this tables W_ and S_ - it also seems that the issue with the new ROW_WIDs will continue...

    Pls someone care to comment or offer a better solution?

    TXS. A lot.

    Antonio

    Assume that the table is W_ASSET_D or any other dimension...

    Yes, I plan to the OOB card personalization (in the folder custom, etc.).

    So if I'm correct... the option for setting null date discount for the W_ASSET_D table... and the use of DAC pointing to the custom task will take care of him...

    Just to be sure... It will not create new ROW_WIDs for W_ASSET_D?

    I'm worried by the _F FKs to this dimension tables...

    TXS for your help.

  • ADD A NEW COLUMN NOT NULL

    Hello
    I try to add a new column not null in the emp default table exist. Initially, I created the column (like BONUS) and then I try to apply the constraint in this amended by order. But it does not happen I mean forced is not added to the column as already the column will have NULL values for records existing (or lines). Can someone help me how to solve the problem?

    Thank you and best regards,
    Vishnu.

    first disable constraint...

    ALTER table dept change the ur_constraint_name disable constraint;

    then insert the data can

    ALTER table dept change the ur_constraint_name novalidate constraint;

    then

    ALTER table dept change enable NOVALIDATE constraint ur_constraint_name;

    Try this we can help

  • Add the new column on BSE page

    HII ALL

    I have a search page when I search on this page with a few criteria
    It shows a region of array type on what it shows all records in the db, that match this search criteria
    now, I want to add a column at the end of this table on the EBS page that displays
    and I want to show some value related to this record that is displayed on this table

    How can I get this value db linked to some folder basis

    and how do I set new column at the end of the table?

    Hussain

    Here are the steps you need to perform.
    1) go to the page with this region of the table. Click on this link page
    (2) check the name of the VO attached with the region of the table and click
    (3) in this page, you can see all of the attributes that are present in the original Version
    (4) if the new attribute you want to display exists in the vol. note his name.
    (5) create a new column in the region of the table through customization and attach this attribute VO with her as well as the view Instance.

    If this attribute does not exist in the original Version, then you must go for the extension of the VO.

    It could be useful!

    Thank you
    AJ

  • Add a new column in a report to rich TEXT format

    I have a report to rich TEXT format and I want to add a new column that contains a formula of addition of let's say column A5 and A7. How do I get there? the A5 and A7 columns are the data loaded from the XML file. Thank you

    The example given by Vetri is for the actual columns in the xml file only.
    You can use

    Make sure that the values are not null. If so, convert or conditionally replaced by 0 number and use it.

Maybe you are looking for

  • Storage space missing afte burning multiple disks

    I am running Yosemite (10.10.5) on a 15 "MacBook Pro with the display Retina (MBP). In the last four days, I burned about ¾ of a terabyte of various files (mostly photos) on DVD and CD using a USB 3.0 external drive (Pioneer BDR-XD06S). I copy a Seag

  • Satellite A300D-17F - HDD is the reason for the slow-running?

    Hello For long time I wrote the problem of my computer that is on the performance and today that I realized its hard drive is ATA. You have an idea the reason for the slow performance is?Satellite A300D 17F By the way who advised thanks me avira anti

  • On the Satellite P500 microphone does not work well

    I spent $2,000 to buy this Satellite P500 a month ago and soon found that the microphone does not work well. I used the web camera application to record a video to test, the volume level is very low that you barely hear it and it cracks. I called the

  • Xbox 360 Black Ops 2 I'm connected to xbox live, but when you go to the multiplayer, it says that I am not

    Hey guys,. I checked my status on the xbox live for black ops 2 and all said I'm good. So I know that I'm not banned... but I can't play online for only Black Ops 2. I connect to xbox live from the dashboard and then what game to start and go to the

  • Cannot install the update KB274597

    Cannot install update KB274597 and me do NOT classify computer technology... plse help with download E-mail address is removed from the privacy *. I ran the Fix - it and this aid has NOT helped.