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;

Tags: Flex

Similar Questions

  • How to assign values to the nested table and passes as a parameter for the procedure?

    How to assign values to the nested table and passes as a parameter for the procedure?

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type1 is table of the test_object1;


    create or replace type test_object2 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type2 is table of the test_object2;


    GRANT ALL ON test_object1 to PUBLIC;


    GRANT ALL ON test_type1 to PUBLIC;


    GRANT ALL ON test_object2 to PUBLIC;


    GRANT ALL ON test_type2 to PUBLIC;

    Here is the table object type:

    create the table test_object_tpe
    (
    sl_num NUMBER,
    Description VARCHAR2 (100),
    main_val1 test_type1,
    main_val2 test_type2
    )


    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS earlier2;


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

    Here is the procedure that inserts values into the nested table:

    PROCEDURE INSERT_TEST_DATA (sl_num in NUMBER,
    Description in VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    )
    IS
    BEGIN

    FOR rec in p_main_val1.first... p_main_val1. Last
    LOOP

    INSERT INTO xxdl.test_object_tpe
    (
    sl_num,
    Description,
    main_val1,
    main_val2
    )
    VALUES
    (
    sl_num
    description
    test_type1 (test_object1)
    p_main_val1 .val1 (CRE),
    p_main_val1 .val2 (CRE),
    p_main_val1 .val3 (rec)
    )
    )
    test_type2 (test_object2 (p_main_val2 .val1 (CRE),
    p_main_val2 .val2 (CRE),
    p_main_val2 .val3 (rec)
    )
    )

    );

    END LOOP;

    commit;

    END INSERT_TEST_DATA;

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

    Here are the block anonymoys what values attributed to the object type and pass values in the procedure:

    Set serveroutput on;

    declare

    p_sl_num NUMBER: = 1001;
    p_description VARCHAR2 (50): = 'Test Val1;

    inval1 test_type1: = test_type1();
    inval2 test_type2: = test_type2();

    Start


    inval1 (1) .val1: = "testx1";
    inval1 (1) .val2: = "testx2";
    inval1 (1) .val3: = "testx3";

    inval2 (1) .val1: = "testy1";
    inval2 (1) .val2: = "testy2";
    inval2 (1) .val3: = "testy3";

    CSI_PKG. INSERT_TEST_DATA (sl_num = > p_sl_num,)
    Description = > p_description,
    p_main_val1 = > inval1,
    p_main_val2 = > inval2
    );

    end;
    /
    Someone can correct me.

    Thank you
    Lavan

    Thanks for posting the DOF and the sample code but whenever you post provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
    >
    How to assign values to the nested table and passes as a parameter for the procedure?
    >
    Well you do almost everything bad that could be hurt.

    Here is the code that works to insert data into your table (the procedure is not even necessary).

    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    
    INSERT INTO test_object_tpe
    (
    sl_num,
    description,
    main_val1,
    main_val2
    )
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /
    

    See example 5-15 making reference to an element of nested Table Chapter 5 using PL/SQL collections and records in the PL/SQL doc
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#CJABEBEA

    1. you don't even have the procedure because it is a simple INSERTION in the table you can do directly (see my above code)

    inval1(1).val1 := 'testx1';
    

    Since you have not yet created all the elements, there is no element 1 "inval1". You need EXTEND the collection to add an element

    inval1.extend();
    

    And then, there is an empty element, but "inval1" is a container for objects of type 'test_object1' not for scalars as "val1", "val2", and "val3".
    If you can not do

    inval1(1).val1 := 'testx1';
    

    You must create an instance of 'test_object1 '.

    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    

    And so on for the other collection

    You don't need the procedure (as my code example shows), but once you fill in the variables correctly it will work.

  • How to assign values to the current element where the cursor is?

    Hi all

    I have a block of "tabular" data, B_Emp (from the Employee table) and the other non-database & non tabular block consisting of a text_items B_Test.

    'Emp_id' is one of the column in the Employee table and I want to attribute all the values of the Emp_id in all text_items of the B_Test in order, when you press a particular key.

    Here's what I wrote in the trigger

    Declare

    i the number;

    number of l_last_record;

    next varchar2 (40); -to hold the values of cursor system of the next item in the block of B_Test

    next_r varchar2 (40); -to hold the values of cursor system of the next record in the block of B_Emp

    Begin

    go_block ('B_Emp');

    Set_Block_Property ('B_EMPLOYEES_ALL', DEFAULT_WHERE, "Emp_id is not null");

    execute_query (no_validate);

    last_record;

    l_last_record: =: system.cursor_record;

    premier_enregistrement;

    next_r: =: SYSTEM. CURSOR_ITEM;

    go_block ('B_Test');

    Next: =: SYSTEM. CURSOR_ITEM;

    because me in 1.l_last_record

    Loop

    go_item (Next);

    : next: =: B_Emp.Emp_id;-here is the problem

    next_item;

    Next: =: SYSTEM. CURSOR_ITEM;

    go_item (next_r);

    next_record;

    next_r: =: SYSTEM. CURSOR_ITEM;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";

    End loop;

    End;

    Now, this gives me the expected bad Bind Variable error as there is no block of data with the name "next".

    However, I checked the value of 'next' and 'next_r' (message (' value = ' | next)) and I'm getting the expected values.

    So if somewhere, I am able to put my value in the current item the cursor (because at the beginning of the loop, my cursor system is exactly to the text element where I need to insert the value) so I did not have to use this " : next: =: B_Emp.Emp_id;"

    OR

    If somewhere, I am able to return the items in my B_test block dynamically so I can simply use

    Loop

    ": B_test." dynamic reference for the element ": = : B_Emp.Emp_id;

    next_record;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";



    Please help me out of this!

    Guy! I found a solution for the same thing.

    We can use integrated a 'copy' to set the values of the element where currently is cursor system.

    The syntax will be

    Copy ((new_value): System.Cursor_Item);

    -where new_value is the variable that contains the data to be assigned.

    In addition, we can assign the values from the system cursor to any variable.

    The syntax will be '

    new_value: =: System.Cursor_Value;

    Thanks a lot guys for your help and concern

    See you soon!

  • Before the process of pl/sql header to assign values to the elements on the page

    How can I assign values to the elements of a page based on the data structure returned by a pl/sql procedure in the front header process? I think execution of a pl/sql procedure based on a URL parameter value and then assign values to the page elements. Is this really possible using Apex 4.0.2? If so, how can it be done?

    Thank you

    Salome

    The question is not really clear. What kind of "data structure returned by a procedure from pl/sql? Please be much more accurate.

    For a data structure of PL/SQL such as records containing 2 elements (x and there) returned as output parameter for a procedure to be assigned to 2 items p1_x and p1_ypage, all that is necessary in the header before process is something like

    declare
    ...
      l_rec rec_type;
    ...
    begin
    ...
      the_proc(..., p_out => l_rec, ...);
    
      :p1_x := l_rec.x;
      :p1_y := l_rec.y;
    ...
    end;
    
  • Save the selected value from the ListBox with its respective values control tab dropdown selected in another list box

    Hi all

    I'm doing a vi where I save the selected value from the ListBox with values respective tab control dropdown selected in another list box. Whenever I select Item1 can change of course and the respective tab will be open for this element. But now I want to just save the selection and put it into another ListBox.SO I can't renmove or add my wishes. Please help me.

    It will work.

    Probably not the greatest solution well.

  • How to assign values to the application points to leave on a table

    Hello

    I have a FORM on a table with two or three elements. How to assign values to the elements of the application with the values in the elements of form, every time the value of the element is entry, change or page is sent?

    I created a dynamic action to the region level with Event - change to run the suite of PL/SQL, I tried with 3 different ways in PL/SQL, as shown below, but it didn't work.

    BEGIN

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v ('P1_FY'));

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v: P1_FY);

    END;

    Then I created an action dynamic at the ITEM level with change event to run the suite of PL/SQL and tried with PL/SQL, as shown below, but it didn't work.

    I need to assign values to the elements of the request form as these elements of the application will be used in many other pages in the application. How to I get there?

    Thank you.

    If a dynamic action of PL/SQL execution, you must send your list of page elements in the parameter "Elements of Page to submit.

    See the section 'run pl/sql' for this post.

    If the page is submitted, the elements of the page will be automatically set to session state, and you can have a page process make the code you have.

  • Impossible to select the value from the search screen (quick select, then) on OFA

    Hello

    We have a problem with a user who are not able to select any value from the LOV on any page of the Oracle.

    1. click the button of LOV

    2. search + go

    3. Select or quick selection nothing happens (error on the Page appears in the left corner of the homepage)

    4. only cancel works.

    Any suggestion would be appreciated.

    I saw a similar question posted Impossible to select the value from the search screen (quick select, then) on OFA

    But unfortunately this is not the answer.

    Thank you

    Sam

    Display of the solution to help others. I tried to connect a SR and suddenly a pop Note ups that helped.

    The problem is related to the profile "Self Service Accessibility Features" customer has defined for the user concerned.

    Follow these steps:

    1 change the value of 'None' profile at the user level.

    2 disconnect / connect to the application and testing.

    See you soon.

  • Restore the default value from the drop-down list

    Hyperion Inreatctive reports.

    I have an embedded in a dashboard report.  I drag the lists that filter the report.  Filter feed results and it works fine.

    I want to put a command button on the dashboard that restores the default values from the dropdown lists.  I have a selection in each drop-down menu, 'all '.  "All" is the default value.

    For example, for the year

    drop_Year

    for the region:

    drop_Region

    What command should I put on the command button that any value is displayed in the drop-down lists of this command, restore it to "all"?


    Watch the Select() method

    w

  • Need to use values from the first query in other queris to the data model

    Hello
    Here is my requirement-

    I use the data model to run multiple queries. The first query, I get 10 records. Now, I want to use these 10 records in the second query to get my final result. I am not able to use the sub query as the two motions are quite long and complex.

    Select distinct Bishop of emp

    Select empno, emp where Bishop in (: Bishop)

    I can't use: Bishop because it will give only the last value stored at Archbishop. Is it possible to be able to use all the values from the first query in the second query using the data model?

    Hello

    Are you sure that you have your "dataStructure" configured correctly? Try this simple example:

                                                                          
    

    Hope this helps

    Andy

  • I am trying to install VideoCam Suite 3.5 from the original CD. It worked fine on my old computer which has Vista.

    I am trying to install VideoCam Suite 3.5 from the original CD. It worked fine on my old computer which has Vista.  It worked fine on my old computer which has Vista. My new computer is Windows 7 and I get the message "use an environment to display 1024 * 768, 16 bits or more. I don't know what that means and I don't know how to achieve this necessary "display environment.

    The video camera is a Panasonic SDR-H100 with VideoCam Suite 3.5 CD to operate.

    designates the monitor display settings 1024 * 768

    This means that the software is probably not supported under win7, visit the site to see if the software update is available for use with your camera Panasonic

    http://Panasonic.jp/support/global/CS/soft/download/vcs35l011.html

  • Images high resolution that I matter IIN indesign appear in a definition very mlauvaise to the screen and once exported to pdf, they are still quite far from the original. Perhaps to remedy these problems.

    Images high resolution that I import in indesign appear in a very bad definition on-screen and when exported to pdf, they are still quite far from the original. Perhaps to address these problems?

    The bad export quality could be linked to the pre-selection of PFD you have chosen. Some of the presets are designed to re - sample images to make a smaller final PDF

  • I had to do a clean install on my pc under XP sp2 and install windows 7. I saved my CS4 extended files but it wont let me install from files, it is said to run from the original disk which I can't find. My product key is on my Adobe account

    has had to do a clean install on my pc under XP sp2 and install windows 7. I saved my photoshop CS4 extended files but it wont let me install from files, it is said to run from the original disk which I can't find. My product key is on my Adobe account. Can I make a download for my product on the Adobe Web site, which is not a trial? It all started with the upgrade of my other pc for windows 10... long story. I have the disks Creative suites 5 and 5.5 but this pc is only 32 bits, and the only one that works with my Epson Stylus pro 4800. Help please

    kglad links in response to #1 here can help https://forums.adobe.com/thread/2017859

  • "Adobe Creative Suite 4" is compatible with the o/s 10.6.8 iMac.  and if I can reinstall this application from the origin of the original disc

    "Adobe Creative Suite 4" is always compatible with the o/s 10.6.8 iMac. ?  Can I REINSTALL the application from the original disc I made originally in 2009?

    CS4 must remain consistent with the requirements of the System 10.6 | Adobe Creative Suite 4, products of Point

    If you can't install it with the disc, you can download the installation files and use the serial number of the disc to activate it.

    CS4 - http://helpx.adobe.com/creative-suite/kb/cs4-product-downloads.html

  • Since yesterday, I can't export to Flickr more. The following message (I translate from the french, so probably different from the original English message): "an internal error: comma symbol was expected.»

    Since yesterday, I can't export to Flickr more. The following message (I translate from the french, so probably different from the original English message): "an internal error: comma symbol was expected.»

    Flickr is flaky again.  You'll just have to wait (minutes, hours, or even days).   It happens more often that Yahoo is falling apart.

  • When you use Adobe Acrobat Pro DC, how do I convert my PDF to Excel and have it include the header and footer from the original PDF? I can't get it on down to the Excel worksheet.

    When you use Adobe Acrobat Pro DC, how do I convert my PDF to Excel and have it include the header and footer from the original PDF? I can convert all information of an organization but the footer and header with no discharge in the excel worksheet.

    Hi trudyb54940538,

    Converting PDF file to sheet Excel spread, header & foot is not included.  I am able to reproduce the problem at my end.

    Thanks for reporting the issue.

    Kind regards
    Nicos

Maybe you are looking for