Adding dynamically columns to array field

hello..
I am trying to create a window class with an ArrayField. The number of
DataField s in the ArrayField s are known at run time.
I created an nonWindow class (say Row )with an attribute FirstCol of type
Textdata.
I created a window class and using the window editor i created a datafield
with
name FirstCol which matches with the row class attribute.
I made datafield into an arrayfield with properties, name = arfield and
type = array of Row
I created a datafield and named to TemplateField (used as a template for
adding
columns )
On click of a button,I am able to add any number of DataField at run time
to the ArrayField by any of the following two ways successfully.
1) <TemplateField>.Parent = <arfield>;
2)<arfield>.AddColumn(2,<TemplateField>);
But i am failing both in adding data pragmatically to the added column and
retrive data from the newly added field even after the field by the folling
way
<arfield>.children[2].Name='Column2';
U can assume that all fields that are going to be added at run time are used
to store string data.
Please inform me if any one knows about this.
Waiting for responance..
Ramesh kumar reddy
[email protected]
PSI Data Syatems Ltd,
Bangalore,
INDIA.

hello..
I am trying to create a window class with an ArrayField. The number of
DataField s in the ArrayField s are known at run time.
I created an nonWindow class (say Row )with an attribute FirstCol of type
Textdata.
I created a window class and using the window editor i created a datafield
with
name FirstCol which matches with the row class attribute.
I made datafield into an arrayfield with properties, name = arfield and
type = array of Row
I created a datafield and named to TemplateField (used as a template for
adding
columns )
On click of a button,I am able to add any number of DataField at run time
to the ArrayField by any of the following two ways successfully.
1) <TemplateField>.Parent = <arfield>;
2)<arfield>.AddColumn(2,<TemplateField>);
But i am failing both in adding data pragmatically to the added column and
retrive data from the newly added field even after the field by the folling
way
<arfield>.children[2].Name='Column2';
U can assume that all fields that are going to be added at run time are used
to store string data.
Please inform me if any one knows about this.
Waiting for responance..
Ramesh kumar reddy
[email protected]
PSI Data Syatems Ltd,
Bangalore,
INDIA.

Similar Messages

  • Adding dynamic columns to region

    I have four tables named projects,Sharedservices,Characteristics,Quantitystructures. The Sharedservices and Characteristisc tables are linked together using Sharedservice Id field. The Quantitystructures table is linked with Projects and Characteristics tables using Project Id and Characteristic Id fields respectively. I have a form that contains three select list items one for selecting the Sharedservice. When the Sharedservice is selected the Characteristic item gets populated automatically with the selected Sharedservice Characteristcs. The third item is the timestamp displaying the months from the Month table.
    The region displays Project Name and the amount of utilization for the selected Sharedservice and the corresponding Characterisctic for a particular month.
    Now what I want to do is that when a Sharedservice is selected dynamic columns should be added to the region depending on the number of Characteristics the Sharedservices has and they should be linked to the amount field.
    The reason to do this is that I want the end users to just select the Sharedservice and then enter the amount of utilization for the respective Characteristics instead of first selecting them one by one from the Characteristics item and then entering the utilization amount by the projects.(The amount field is present in the Quantitystructures table)
    I would really appreciate any help on this issue.
    Edited by: user11298661 on Jul 8, 2009 10:57 PM

    Hi,
    I'm not 100% clear on what is on the page. "Column" usually refers to a column in a report or tabular form. Is this what you mean? Or do you want to show individual pages items?
    Is the data for the characteristics being stored as individual records on the table for each characteristic? Or, is there a single record for all characteristics for each Sharedservice and you want to show/hide some of these?
    Andy

  • Adding Dynamic column to datagrid at the begining of datagrid

    Hello friends,
    There is one datagrid which is static. and i m adding one dynamic column. it is get added to the end of the static datagrid
    but I want to add dynamic column at the begning of the datagrid can anybody help me on this.
    Thanking you,
    Regards,
    gajanan

    Thanks to everybody.
    finally i got the things to work using following code.
    private  function SwapGridColumns (DG:DataGrid, Col1:Number, Col2:Number):void
                    var i:Number; // Counter
                    var DP:ArrayCollection =ArrayCollection( DG.dataProvider);     //DataProvider
                    var Widths:Array = new Array ();     // the widths of the columns
                    var Columns:Array = new Array ();    // the column names
                    var Visibility:Array = new Array (); // visibility of columns
                    var HRenderer:Array = new Array ();   // Header Renderer of columns
                    var IRenderer:Array = new Array();
                    var datastore:Array = new Array ();
                    var Editable:Array = new Array();
                    var DFields:Array=new Array();
                    var Sortable:Array = new Array();
                    for (i = 0; i<DG.columns.length; i++)
                        if (i == Col1)
                            Columns.push(DG.columns[Col2].headerText);
                            Widths.push(DG.columns[Col2].width);
                            Visibility.push(DG.columns[Col2].visible);
                            HRenderer.push(DG.columns[Col2].headerRenderer);
                            IRenderer.push(DG.columns[Col2].itemRenderer);
                            Editable.push(DG.columns[Col2].editable);
                            Sortable.push(DG.columns[Col2].sortable);
                            DFields.push(DG.columns[Col2].dataField);
                        else if (i == Col2)
                            Columns.push(DG.columns[Col1].headerText);
                            Widths.push(DG.columns[Col1].width);
                            Visibility.push(DG.columns[Col1].visible);
                            HRenderer.push(DG.columns[Col1].headerRenderer);
                            IRenderer.push(DG.columns[Col1].itemRenderer);
                            Editable.push(DG.columns[Col1].editable);
                            Sortable.push(DG.columns[Col1].sortable);
                            DFields.push(DG.columns[Col1].dataField);
                        else
                            Columns.push(DG.columns[i].headerText);
                            Widths.push(DG.columns[i].width);
                            HRenderer.push(DG.columns[i].headerRenderer);
                            IRenderer.push(DG.columns[i].itemRenderer);
                            Editable.push(DG.columns[i].editable);
                            Sortable.push(DG.columns[i].sortable);
                            DFields.push(DG.columns[i].dataField);
                    // Reset the widths
                    var col:Array
                    for (i = 0; i < Columns.length; i++)
                        var DGC:DataGridColumn = new DataGridColumn(Columns[i]);
                        DGC.width = Widths[i];
                        DGC.visible = Visibility[i];
                        DGC.headerRenderer = HRenderer[i];
                        DGC.itemRenderer = IRenderer[i];
                        DGC.dataField=DFields[i];
                        DGC.sortable=Sortable[i];
                        DGC.editable=Editable[i];
                        datastore.push(DGC);
                    DG.columns=datastore;
                    // Load DP
                    DG.dataProvider = DP;
    Regards,
    gajanan

  • Adding dynamic columns in Table Control

    Hi All,
    Can we add dynamic columns in a table control? The requirement is something like this. When the user clicks a button it should add a column to the table. Also is it possible for the same column to refer to different fields of the Internal Table of the Database table. Example. The first row in the table control must refer to MARA-MATNR and the second row must refer to MAKT-MAKTX.
    Regards,
    Sudhindra

    Hello Sudhindra,
    If you know all the columns that the table control will ever contain, then I suppose it is possible to add and delete the columns dynamically.
    What cannot be dynamic, is the determination of which coulmn would be displayed in the table control.
    To elaborate, In SE51, you have to define the table control with all the possible columns. In the program, during the PBO, you can choose to hide some of these columns. When the user performs certain action (PAI), you can determine which opf the hidden columns would be displayed in the table control after the next PBO.
    Coming to your second requirement, I don't think it is directly possible in case of table conrols. You will have to do some manipulation to achieve it. But even if you can I think you should not. Because, It is not elegant from a good-UI design perspective. ANd during the course of the necessary manipulations, we might have to forgo some of the features like Automatic Field Validation, Automatic Input Help etc. You can use ALV for the same.
    Please be judicious in deciding which approach to consider and if you run into some more problems, please do get back with some more details like how many columns you have, how many different row-types do you want, what are the features for the fields that you wish to provide (eg. F4 help) an so on...
    Regards,
    Anand Mandalika.

  • Dynamic column Headers without field symbols

    Hi All,
    how to create a dynamic column header(Not a Dynamic Column with Hard Coded One) with Internal Tables
    (Not with Field Symbols as i can find some programs with field symbols  during search) .
    Please Provide an example wih some piece of sample code .
    Any Help would be appreciated.
    Thanks & regards,
    Ravi S.

    You will have to use dynamic programming techniques for the same, there is no other way around I can think of.
    You will find Rich's Blog quite helpful,
    [Dynamic Internal Table|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID1759109750DB10206591421434314571End?blog=/pub/wlg/2071]
    If you haven't used field symbols before, just do it this time, they are very helpful for dynamic programming.
    Thanks,
    Aabhas

  • Help me adding dynamic column in JSP

    Hi!
    Can any body please tell me how to add a column DYNAMICALY in JSP?
    I am using a drilldown and I want to add the next column after every + is clicked in drilldown.
    *If you have something to e-mail then please e-mail me at my below given e-mail address.
    Regards
    Ashish Bagora
    <[email protected]>

    I guess you're referring to a column table.
    You can simply submit to server and regenerate the page or you can add the column using Javascript DOM manipulation function.

  • Problem in creating dynamic array field.

    Hi there,
    Following are the steps we followed to dynamically build the array field.
    1) Single column array field created with a single widget in the design time.
    2) Few more columns were added using 'Addcolumn' method.
    3) Data in the array object mapped to the array field is populated.
    4) All the dynamic field state was set to FS_UPDATE.
    5) Used Updatefieldfromdata method in all levels ( window, compound field, field widget).
    Problem faced
    1) Data is not visible in the dynamic fields created. But the data is visible in the field created during design time.
    Appreciate, if given any solution for this.
    Regards,
    Anand.

    if you don't see your text, you're not embedding the font.
    when you use actionscript to embed a font, you need to have the font in your library with a linkage id, create a textformat instance and assign its font property and finally assign the textformat to your textfield.  for example
    _root.createTextField("txt",_root.getNextHighestDepth(),50,50,50,50);
    _root.txt.embedFonts=true;
    _root.txt.text="hello";
    _root.txt._rotation=20;
    var tfor:TextFormat=new TextFormat();
    tfor.font="yourfontslinkageid";  // <- linkage id of font in your library
    _root.txt.setTextFormat(tfor);

  • Dynamic columns in SBWP

    Hi.
    can any one explain stepby step process of adding dynamic columns in SBWP.
    thanks & regards,
    arul.

    hi
    Inside SBWP u2013 inboxu2014Right click on u201Ctitle u201D Tab   of INBOX  It will list down all the  possibilities  to handle columns or add columns.
    (below Inbox is writen , RIGHT CLICK ON any column name .) you will get options like Show , this will help you to add more columns
    thanks
    kakoli
    Edited by: kakoli debroy on Jul 28, 2009 1:58 PM

  • How to hide columns that are getting added dynamically to UI Element 'Table

    In SRM 7.0 while displaying a RFx, click on "responses and awards" button.
    In the response comparision tab once the user selects response number and clicks on "compare all responses".
    Item details table is displayed with fields item number,internal number,item description,........,Price etc.
    Requirement is  to hide the price column from the table.
    The UI element type is 'Table'.
    But the catch is there is no column price visible at layout design level.
    This field is getting added dynamically at run time.
    When i right click and see the 'more field help' at the front end i get the field id as 'GRP_1_COL_3_TXTV'.
    lo_table ?= view->get_element( id = 'ITEMS_TABLE' ).
    lo_column = lo_table->get_column( id = 'GRP_1_COL_3_TXTV').
    ASSERT lo_column IS NOT INITIAL.
    lo_column->set_visible( EXPORTING value = '01' ).
    I had written the above code in the pre-exit of WDDOMODIFYVIEW.
    But i am getting dump as assertion failed.it says no column by name 'GRP_1_COL_3_TXTV'.
    Please help me inhow to hide fields or buttons getting generated dynmically.
    Regards,
    Venkat Raghavan.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • Adding the columns dynamically in crystal report

    Hi,
      I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
    Thanks
    Sankar

    Hello Sankar,
    please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
    This sampels retrieves the table column name from the database and adds it to the report.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Add_Field_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
            CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    AddField.rpt");
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                //Get the first section in the details section
                   boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                   //Create the field object that we will add to the report and set all of its properties
                   boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                   boFieldObject.DataSourceName = "{Customer.City}";
                   boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                   boFieldObject.Left = 4 * 1440; //1440 twips per inch
                   boFieldObject.Width = 3 * 1440;
                   boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                   boFieldObject.FontColor.Font.Name = "Arial";
                   boFieldObject.FontColor.Font.Size = 10;
                   boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                   //Add the object to the report
                   boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Get the first section in the details section
                boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                //Create the field object that we will add to the report and set all of its properties
                boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                boFieldObject.DataSourceName = "{Customer.City}";
                boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                boFieldObject.Left = 4 * 1440; //1440 twips per inch
                boFieldObject.Width = 3 * 1440;
                boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                boFieldObject.FontColor.Font.Name = "Arial";
                boFieldObject.FontColor.Font.Size = 10;
                boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                //Add the object to the report
                boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;

  • How to add get the field name for a newly added site column.

    I have the following:-
    Enterprise wiki site collection inside SharePoint server 2013.
    I added a new site column of type managed metadata.
    I opened the enterprisewiki.aspx page layout using the SP designer, to add the newly added site column to it.
    But I have noted that to add any site column I need to know the field name , for example the default wiki category column is referenced inside the page layout as follow:-
    <Taxonomy:TaxonomyFieldControl FieldName="Wiki_x0020_Page_x0020_Categories" EmptyValueDescriptionForTargetTemplate="<%$Resources:cms,enterwiki_nocategories_assigned%>" DisableInputFieldLabel="true" runat="server"/>
    <b>
    So my question is how I can know the field name for my newly added site column?
    Thanks in advance for any help.
    Regards

    Hi,
    The “FieldName” should be the internal name of the column, you will find it at the address bar at the “Site Columns”->”Edit Column” page:
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Retain field order on form when adding/deleting columns

    If I move my html around to change the layout of the fields on an AddForm.aspx and then I start adding and deleting columns, the ordering of the ff## changes and I can have problems. 
    Its fine if I've only added new columns...what I've done is create an AddForm1.aspx to get the fresh ff##'s at the end of the list.  I copy them over to my AddForm.aspx
    If I add and delete columns, then I can have problems.
    The ff## may be renumbered when making an AddForm1.aspx and copying the new fields might create an error because of dupe ff##'s.
    If I use AddForm1.aspx,  I lose my layout of the fields on my form AddForm.aspx.
    I have been successful finding the ordering of the columns on AddForm1 and renumbering on AddForm.
    But this is pain and error-prone.
    What do people do to get around this dilema?
    thx
    Rich

    Hi,
    By default, we can change the order at the Lists content type settings page.
    I suggest you provide more information about your requirement(screenshot) to make others easier to find a solution for you.
    More information:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/31a5030b-9494-4057-b4ad-485435fdceb0/sharepoint-designer-2010-reorder-fields-for-newform-edifform-viewform?forum=sharepointgeneralprevious
    http://kalsing.blogspot.com/2006/11/create-custom-list-form-for-sharepoint.html
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • How to display dynamic column added by vo.addDynamicAttribute in jspx?

    Hi,
    I met problem when programmatically add cloumn and display it on screen. Here are my steps:
    0. define a ViewObject using xml. Define a transient column Addtion2. later will add a dynamic column Addtion3, but not defined here.
    1. Implement Application Module, adding a method init() and expose it to client.
    2. In init() method, get target VO and use vo.addDynamicAttribute("Addition3"). Then iterate it use row.setAttribute("Addition3", Math.random()). Add init() to page binding and invoke it.( it's invoked )
    3. In jspx, use dynamic table. But Addition3 never shows up.
    This is my last question: Re: How to display dynamic column added by vo.addDynamicAttribute in jspx? People say I should use dynamic table.
    please have a look at my code:
    Application Module: when it runs, it will print 6 coulmns. vo.getAttributeCount() is <font color="red">6</font>.
    <pre>
    public void init() {
    ViewObject vo = this.getCountryView1();
    if (vo.getAttributeIndexOf("Addition3") == -1) {
    vo.addDynamicAttribute("Addition3");
    vo.executeQuery();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    RowSetIterator it = vo.createRowSetIterator("i1");
    while (it.hasNext()) {
    Row r = it.next();
    r.setAttribute("Addition2", Math.random());
    r.setAttribute("Addition3", Math.random());
    it.closeRowSetIterator();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    System.out.println(vo.getAttributeCount()); //vo.getAttributeCount() is 6
    </pre>
    jspx: when it runs, only 5 columns are shown. Column Addition2's values are set as expected. but Column Addition3 never shows up. And #{bindings.CountryView1.attributeCount} shows <font color="red">5</font>.
    <pre>
    <af:table rows="#{bindings.CountryView1.rangeSize}"
    fetchSize="#{bindings.CountryView1.rangeSize}"
    emptyText="#{bindings.CountryView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.CountryView1.collectionModel}"
    selectedRowKeys="#{bindings.CountryView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.CountryView1.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:column headerText="#{def.name}"
    sortable="true" sortProperty="#{def.name}" id="c1">
    <af:outputText value="#{row[def.name]}" id="ot1"/>
    </af:column>
    </af:forEach>
    </af:table>
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:outputText value="#{def.name}" id="ot2"/>
    </af:forEach>
    <af:outputText value="#{bindings.CountryView1.attributeCount}" id="ot3"/>
    </pre>
    it's quite weird for me. The vo.getAttributeCount() is 6, but #{bindings.CountryView1.attributeCount} shows 5. And column Addtion3 never shows up.
    what's the matter? How can I show the dynamic added column Addtion3?
    Edited by: simon li on 2012-9-10 下午7:31
    Edited by: simon li on 2012-9-10 下午8:00

    Hi,
    Can you check the tree binding (CountryView1 - in the pagedef) and see it has the 5 attributes hardcoded in it. If yes, try removing everything and then run the page to see if it works fine.
    -Arun

  • Adding dynamic split column width to my report

    I'm trying to add a dynamic split-column-width to my report in BI Publisher. I do not have a need for a column header. I tried to add this line to my existing line of code for the cell.
    *<?split-column-width:COLUMN_DATA?>*
    C *<?split-column-width:COLUMN_DATA?>* <?for-each-group@cell:current-group();COLUMN_ORDER?> COLUMN_DATAEC
    I do not under stand the user's guide. What should be placed where to accomplish the dynamic column width and keep my current cell group?
    thank you for your time.

    In the Discoverer Plus (web version but not vieweer), go to Sheet -> Format. For each column click on Format Data and make sure Word Wrap in unchecked. Then click on Format Heading and check on Word Wrap. This will word wrap the column heading but stretch the column to maximum length of the data in the column.
    I think be default word wrap in unchecked unless otherwise specified when the workbook was created.

  • DataGrid with dynamic columns & renderers

    I'm developing using Flash Builder 4 & Flex SDK 4.1.
    I need to manage very dynamic DataGrid components and keep their definitions, which are all part of a complex item renderer of an Offers list.
    The objects structure is simplified as follows -
    Data: Model --> Offers ArrayCollection --> Offer VO --> DataGrid data ArrayCollection & DataGrid columns Array
    View: List --> Offer Item Renderer --> DataGrid
    1. Since the DataGrid's columns property accepts only an Array (not ArrayCollection), it seems like Data Binding for defining the columns is very problematic.
    I tried to bind it to the source property of an ArrayCollection that would keep my columns definitions, but it didn't really work (mainly header display bugs).
    What is the recommended way to keep the dynamic columns definition of a DataGrid?
    2. Each column can have a set of dynamic properties, so I created a "mutant" - Column VO that extends DataGridColumn and got a dynamic properties ArrayCollection on it.
    The columns got a custom header renderer that includes an icon when there are properties.
    The header renderers got 4 main states (NotSelectedWithProperties, SelectedWithProperties, NotSelectedWithoutProperties & SelectedWithoutProperties).
    However, the header renderer area seems a bit buggy when maintaning dynamic columns.
    Any thoughts on the subject?
    3. Anyway, I ended up recreating the DataGrid's columns Array very often (copying the columns definition on the offer's item renderer's dataChange event handler).
    Note that the dynamic properties can be edited when the column is selected and I copy their values from the view back to the model when entering the state NotSelectedWithProperties.
    This feels way too complicated and I really try to keep it simple, inspite of the required complexity.
    Does anyone have better ideas?
    4. In some cases the column's item renderer should also be modified into another DataGrid (grid-in-grid).
    I used the MXDataGridItemRenderer with a DataGrid and included an ArrayCollection for the "newValue" returned by the editor.
    (I use RendererIsEditor=true and on updateComplete populate that variable with the DataGrid's dataProvider contents)
    When needed, I loop though the data objects of the parent DataGrid and populate the related field with an ArrayCollection of key-value objects that are displayed on the internal DataGrid.
    After adding this feature I encounter very strange bugs -
    a. After editing the grid-in-grid values and changing the column's state (selecting & deselecting), I get the following exception:
    ArgumentError. Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/setChildIndex()
    at mx.core::UIComponent/setChildIndex().......6993....
    All I could find about this is that it might be related to some context error or something, but I'm really stuck on this one.
    b. Sometimes another column might copy value from one row to another, running over the previous value.
    I'm not sure exactly what sequence of actions causes this behavior, but it's related to that itemRenderer for sure.
    c. Switching places with a column that uses the grid item renderer (headerShift) causes a stak overflow of StyleManager that tried to get style from the DataGridItemRenderer. This one I just found out, but couldn't reproduce a second time... strange!
    I'm pretty sure this caused another problem that I don't remember at the moment.
    The bottom line is that there got to be a better way to implement this feature within this already-complicated environment.
    Maybe I'm doing something very wrong here...
    Please advice and thanks for reading all this.

    Update on item 4a -
    This was a major issue (the main reason for opening this thread really) and I managed to resolve it!
    As part of my application, I override the default DataGrid behavior for column selection (headerRelease event).
    Instead of sorting, I change the column's header looks and define it as Selected (for showing its dynamic properties and enable its deletion).
    At first I did this by setting styles, but the look didn't refresh unless I created a new instance of the header renderer.
    Later I changed thi behavior to work with states, but I left the new header renderer instance creation commands and those lines created all the mess!
    Conclusion -
    If you define a custom header renderer for your datagrid column and then a custom item renderer, don't create a new instance of your header renderer!
    It would still be nice to get some response for the other issues I raised.
    Thanks and have a nice week.

Maybe you are looking for

  • Cannot delete Mac OSX partition, need help

    Hi,      I recently checked my storage space on my 256 GB Macbook Pro and realized that I only have 199 GB of total available space.  Checking the Disk Utility, it appears that somehow I ended up with an "Untitled 2" partition that is taking up about

  • Canon 6D, Bridge CS5, Camera raw 6.7.1 -- cr2 files not shown

    I use Bridge CS5 with camera raw 6.7.1 in combibnation with a canon 6D and a canon 5D Mark2. The raw files from the 5D are shown in bridge, the raw files from the 6D are not. There is just an icon. The camera raw add-on is the latest usable update fo

  • Save selection coordinates - simple nerdy script

    Hello, I've uploaded a little illustrator script that might be handy to some. Ideally designers collaborating with developers could use this, because what it does is fairly simple: it exports the coordinates of selected items in a document. Designers

  • Adobe premier elements 12 sous mac

    Bonsoir, J'ai acheté la version 12 d'adobe premier elements ce week-end et je suis sous mac. J'ai un gros soucis avec cet outil car tout mes fichiers sont endommagés et impossible de les ouvrir. Je travaille sur une video lourde de 4h que j'ai scindé

  • Still photo pan

    I am trying to create an effect that a still photo is being panned or zoomed any suggestions? thanks