Accessing ArrayCollection Field Names

Hello, this may sound like a n00b questoin but, I have an array collection which looks like the below:
    public var topFive:ArrayCollection = new ArrayCollection([
         {Month:"GAME_Redemptions"},
         {Month:"TALLINK_Redemptions"},
         {Month:"YvesRocher_Redemptions"},
         {Month:"ETAM_Redemptions"}
With a loop for example, if I want to access the Value, I would type, topFive[i].month. However, if I want to access the Field name what would be the code. Im assuming it would be something like topFive[i] - but this does not return the desired output.
Does anyone know how to do this? I wanted to avoid having to put the array into a datagrid and then extracting the values from there.
Please help!
Craig

Thanks for your response, much appreciated. It works perfectly. Do you know how to delete a whole column out of an array coll
ection?
e.g.
    private var topFive:ArrayCollection = new ArrayCollection([
                 {Month:"GAME_Redemptions", value:10},
                 {Month:"TALLINK_Redemptions", value:10},
                 {Month:"YvesRocher_Redemptions",value:10},
                 {Month:"ETAM_Redemptions",value:10}
To
                 {Month:"GAME_Redemptions"},
                 {Month:"TALLINK_Redemptions"},
                 {Month:"YvesRocher_Redemptions"},
                 {Month:"ETAM_Redemptions"}

Similar Messages

  • Spaces within access db field name

    I am trying to use data which was extracted to a excel file
    then imported into a access database.
    During the import access database used the first roll to be
    the field name and some names has space within.
    When I try to access those field inside CF and i will get a
    error message since the CF won's understand any field names with
    space inside the name.
    Is there a work around? Since change the field name each time
    will take lots of time beacuse the db will be exported every day.
    Thanks

    Is there a work around? Since change the field name each time
    will take
    lots of time because the db will be exported every day.
    Thanks
    Yup, two of 'em even.
    The first is in the SQL language, you can alias the columns
    with the AS
    command. This one is probably preferred by most developers.
    SELECT ['Column With Spaces'] AS NoSpaces
    FROM aTable
    Secondly you can use the array notation ability of ColdFusion
    to
    reference variables with bad names. For queries that would be
    queryName[columnName][row].
    <cfoutput query="aBadQuery">
    #aBadQuery["Column With Spaces"][currentRow]#
    </cfoutput>

  • Accessing dynamic field names?

    I want to be able to create text fields with unique names and
    set values in them within a For-loop without having to reference
    the field names in the code.
    Consider the following code snippet:
    this.createTextField("field" + i, this.getNextHighestDepth(),
    x1, y1, 250, 20);
    It places a text field into a movie clip with name that is a
    composite of a literal value and a variable value resulting in
    names like field1, field2, etc. My question: Is there anyway to use
    a composite field name to access the field properties? For example:
    Can I set the text for the field using the same composite name
    without having to express it as a literal field name? If I can't
    then what is the point of having the composite name capability?

    You can drop the last question because the answer to the
    prior one(s) is "yes".
    this["field"+i].text = "whatever";
    the bracket notation causes a string to be evaluated as an
    object/instance.

  • How to dynamicly create a field name AND access it

    All,
    I am trying to build a code block that will access what amounts to a table structure inside a table. I have 38 occurances if a set of 3 fields. (Source system had an internal array/occurs clause that was converted for our ODS into individual fields) I am returning a single row as a row type and have addressability to all fields. What I am trying to avoid is coding my logic block 38 times, 1 for each occurance.
    FOR X IN 1 .. 38 LOOP
    V_CAT_CD_X := 'CAT_'||X||'_CD';
    End Loop;
    The following is the display of the correctly built field:
    --> Loop Cat CD: CAT_1_CD Rec count:1 Loop counter:1
    --> Loop Cat CD: CAT_2_CD Rec count:1 Loop counter:2
    --> Loop Cat CD: CAT_3_CD Rec count:1 Loop counter:3
    --> Loop Cat CD: CAT_4_CD Rec count:1 Loop counter:4
    My problem is that my row cursor PP1 is addressable hardcoding PP1.CAT_1_CD or PP1.CAT_2_CD ect, however I am having problems using my created string to access the field.
    What do I need to do to gain accessability via this method?
    I do have the ability to select the column names from the system tables but even then, I am lacking addressability to my ROW type using the selected field name.
    Thanks
    Greg

    Not sure if this is what you are looking for:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_cur SYS_REFCURSOR;
      3  v_rec mytest%rowtype;
      4  cursor c1 is select column_name from all_tab_cols where table_name = 'MYTEST';
      5  v_sql_stmt VARCHAR2(1000) := NULL;
      6  BEGIN
      7  v_sql_stmt := 'SELECT ';
      8  FOR I IN c1 LOOP
      9  v_sql_stmt := v_sql_stmt||I.column_name||',';
    10  end loop;
    11  v_sql_stmt := RTRIM(v_sql_stmt,',');
    12  v_sql_stmt := v_sql_stmt||' FROM mytest';
    13  open my_cur for v_sql_stmt;
    14  LOOP
    15  FETCH my_cur INTO v_rec;
    16  EXIT WHEN my_cur%NOTFOUND;
    17  dbms_output.put_line(v_rec.a);
    18  END LOOP;
    19 close my_cur;
    20* end;
    SQL> /
    1
    2
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Nov 17, 2010 5:29 AM

  • Can field names not start with a single letter camel case?

    I am using Hibernate 3.6, JPA 2.0, and Spring 3.0.6. I have fields in my objects like the following:
    class PersonContact {
    Long eAddressCpId;
    ElectronicAddress eAddress;
    I use field access (in my orm files) and queries/inserts/etc work without an issue. The fields are both in the class as well as in the orm files. But on startup of the application, the JPA configuration load spits out warnings:
    2011-02-22 15:38:10,785 [[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader - Property com.foo.model.contactpoint.ElectronicAddress.eAddress not found in class but described in <mapping-file/> (possible typo error)
    2011-02-22 15:38:10,801 [[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader - Property com.foo.model.person.PersonContact.eAddressCpId not found in class but described in <mapping-file/> (possible typo error)
    2011-02-22 15:38:10,801 [[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader - Property com.foo.model.person.PersonContact.eAddress not found in class but described in <mapping-file/> (possible typo error)
    2011-02-22 15:38:10,817 [[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader - Property com.foo.model.person.PartyContact.eAddressCpId not found in class but described in <mapping-file/> (possible typo error)
    2011-02-22 15:38:10,817 [[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.hibernate.cfg.annotations.reflection.JPAOverridenAnnotationReader - Property com.foo.model.person.PartyContact.eAddress not found in class but described in <mapping-file/> (possible typo error)
    If I change my field names to be from eAddress to electronicAddress and eAddressCpId to electronicAddressCpId , then I don't get these warnings.
    Is there requirements around the field names?
    Thanks..jay

    Hi,
    If you have this PersonContact.eAddress in your mapping file, Hibernate will look in PersonContact for
    1 a public field called eAddress
    2 a public member method called getEAddress (Or geteAddress).
    3 a public member method called isEAddress(Or isAddress)
    Your fields aren't public, so my guess is that getEAddress is found. From this "get" is stripped away and the rest is "decapitalized".
    This decapitalize method has these lines:
    if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) &&
          Character.isUpperCase(name.charAt(0))){
                 return name;
    }So yes, I think there is a requirement with fields names. (Or rather getter names, since fields aren't decapitalized)
    You could try and change your mapping file into PersonContact.EAddress to see if I'm right.
    Btw, I am not a Java programmer, so this is what I could manage from a poor mans view at this (Open) source of Hibernate's.
    Regards
    Peter

  • Access to fields of a form through IAC

    Hello everyone!
    I created with Adobe LiveCycle Designer ES2 (included with Adobe Acrobat X Pro) an example form with several fields.
    After that I wanted to access the fields through the Acrobat SDK's Interapplication Communication (IAC) capability by using OLE.
    As programming language I choose C# from the .NET framework. But the only field that I could access was the signature field and only when it was signed. I could not figure out the mistake. Is my code wrong? Or is the created form wrong? Can somebody help?
    The code that I used:
    Acrobat.AcroApp app = null;
    Acrobat.AcroAVDoc avdoc;
    AFORMAUTLib.AFormApp formApp;
    AFORMAUTLib.IFields fields;
    app = new Acrobat.AcroApp();
    avdoc = new Acrobat.AcroAVDocClass();avdoc.Open(@"Form.pdf", null);
    formApp = new AFORMAUTLib.AFormApp();
    fields = formApp.Fields;
    int fieldsCount = fields.Count;
    foreach (var item in fields)
      AFORMAUTLib.IField field = (AFORMAUTLib.IField)item;
        result = field.Name + " = " + field.Value + "[" + field.Type + "]";

    Yes, if the form is Reader Enabled, then a Reader user can add a graphic as the icon of a button via scripting to an AcroForm.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Tue, 27 Sep 2011 00:31:26 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Access to fields of a form through IAC
    Re: Access to fields of a form through IAC
    created by gatch<http://forums.adobe.com/people/_gatch_> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/3939773#3939773

  • XSLT for dynamic target field names

    Hello,
    I got a requiremt where I need to create target field names from input values.
    Input XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Field Name="A">
    <Value>1</Value>
    </Field>
    <Field Name="B">
    <Value>1</Value>
    </Field>
    </Createelement_MT>
    Expected OutPut XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Statement><TableName><table>XYZ</table>
    <access>
    <A> 1 </A>
    <B> 2 </B>
    </access>
    </Statement></TableName>
    </Createelement_MT>
    The value of the attribute 'Name' of field 'Field' should be the name of target field.
    XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="Createelement_MT">
    <xsl:element name="statement">
    <xsl:element name="TableName">
    <xsl:element name="table">ABC</xsl:element>
    <xsl:element name="access">
    <xsl:for-each select="Field">
    <xsl:element name="{@Name}">
    <xsl:value-of select="Value"></xsl:value-of></xsl:element></xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    Error:
    Error: at xsl:element on line 15 of file:///......: XTDE0820: Invalid element name. Invalid QName {}
    Please help me with the xslt code for this requirement.
    Thanks!

    Hi,
                Please try this code
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml"/>
         <xsl:template match="/">
              <Createelement_MT>
                   <Statement>
                        <TableName>
                             <table>XYZ</table>
                        <access>
                             <xsl:for-each select="Createelement_MT/Field">
                                  <xsl:variable name="field" select="@Name"></xsl:variable>
                                  <xsl:element name="{$field}">
                                  <xsl:value-of select="Value"></xsl:value-of>
                                  </xsl:element>
                             </xsl:for-each>
                        </access>
                        </TableName>
                   </Statement>
              </Createelement_MT>
         </xsl:template>
    </xsl:stylesheet>
    input xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Field Name="A">
      <Value>1</Value>
      </Field>
    - <Field Name="B">
      <Value>1</Value>
      </Field>
      </Createelement_MT>
    output xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Statement>
    - <TableName>
      <table>XYZ</table>
    - <access>
      <A>1</A>
      <B>1</B>
      </access>
      </TableName>
      </Statement>
      </Createelement_MT>
    One small request, if you think your question has been answered,could you please kindly, if possible, close this thread.
    regards
    Anupam

  • Changing a text field name in an existing PDF via VBA

    Using OLE, I am accessing a given form with the following code:
    Function GetTextFieldNames(strFormName As String, strFieldName)
    Dim myApp As AcroApp
    Dim acForm As Acrobat.AcroPDDoc
    Dim jso As Object
    Dim strTest As String
    Dim Field As Object
    'Set the object references
    Set myApp = CreateObject("AcroExch.App")
    Set acForm = CreateObject("AcroExch.PDDoc")
    acForm.Open (strFormName)
    Set jso = acForm.GetJSObject
    Set Field = jso.getField(strFieldName)
    'Clean up
    acForm.Close
    myApp.Exit
    Set myApp = Nothing
    Set acForm = Nothing
    End Function
    The two items that I would like to achieve are:
    1. Getting a list of fieldnames on the form referenced
    2. Changing the field name (in this case, a textbox or checkbox) programmatically.
    However, I have not had any success in retrieving a list of available field names, nor have I been able to modify the name of the field. Any ideas?
    i.e. It would be nice one could say
    For i = 0 to acForm.[FieldCount]
         Set Field = jso.GetField(i)
         Print Field.Name
    Next i
    ...and
    Field.Name = "NewFieldName"
    I hope that helps to explain what I am trying to accomplish. Any ideas are appreciated. Thank you!

    Have you consulted the documentation in the SDK about what methods are available? It will show you how to get the list of fields and/or the proper count for iteration.
    IIRC you can't change the name via VBA

  • Which table stores field names and their description?

    When I go to se11; I can get information about a table; its field names and field description.
    How can I access same information using an ABP Program? I have a third party tool which connects to SAP; it can pull data from any SAP Table or view. I do not know which table or view stores information displayed in SE11.
    Thanks a lot.

    Hi zigzagdna,
    The field names and their description are strored in table DD03L and DD03T.
    SAP DDIC dictionary informations are generally store in DD* tables. You can search this kinds of DD* tables in SE11 using F4 search help.
    With Best Regards
    Julia

  • Using variable in accessing itab field

    Hi all!
    is it possible to access a field of an internal table using a variable.
    for example, please see my code below.
    DATA: BEGIN OF itab,
            field1 LIKE mara-matnr,
            field2 LIKE mara-matkl,
          END OF itab.
    data: v_fldname(5).
    **- itab is being populated here -**
    v_fldname = 'field1'.
    **- i want to access the first field of itab, field1-**
    ***- but instead of doing this code
    write itab-field1.
    ***- i want to do this...
    write itab-(v_fldname).
    but im getting an error message saying that <<The data object "IT_VAD" does not have a component called "">>
    please send me the correct way to deal with this.
    Thanks for your usual support.

    I dont have a SAP sytem now but This is a sample.
    Field-symbols f_field.
    Assin a value to the field symbol
    Assign f_field value "Field name"
    Now the value "Field name" is stored in F_Field. You can use the value as below
    v_somefield = <f_field>. " V_somefield will now have a value of "Field name"
    - Guru
    Reward points for helpful answers

  • Authorization object to display table field names in english text in SE17

    Hi,
    One of users have issues with the filed name getting displayed in technical format instead of english text while browsing table information in SE17. Normally we can set this in through Settings->User Parameters. But here for this user, user parameter option is greyed out and he doesn't have access to SE16.
    Is there any other way to change user specific parameters, instead of granting him accesss to SE16 or enabling user parameters in SE17?
    Thanks,
    Mano

    Hi,
    I made him run SU53 on SE17 transaction the log is showing that authorization check failed for S_ALV_LAYO with value 23.
    Actually i have access SE16 and for me also, user parameter option is greyed out in SE17. I ran SU53 on SE17 in my session i also got same log.
    One more observation is, the user's colleague also doesn't have access to SE16 and user parameter option is greyed out in SE17 but he can view the table field names in english. So we are wondering if some authorization object is missing here.
    We do not want user to make any changes through GUI.
    Thanks,
    Mano.

  • Changing the field name at runtime in rpt file

    Hi everybody
    I'm using C# and Crystal Report XI (Deverlop license) to develop windows application in VS.net 2003.
    Please help me to change the field name of the bounded column of Crystal report file at the runtime.
    (In some case client's database had changed the structure as fieldname, fieldtype. Then they request a utility to change the field names in the .rpt file programmatically )
    Thanks
    GiangSon
    My email address: [email protected]

    user11200661 wrote:
    That's fine but still i want to prefix the schema name within the .sql file. My .sql should contain the name of that parameter only as i want to get that parameter replaced by the schema name at runtime. Some other users are using the same .sql file and they have access to that specific schema only. i want to make the .sql file more general so that it can be used by everyone without altering it every time.Sorry, your requirement no longer makes sense.
    If people have to access a specific schema because they need the script for general use, then you will have to hard code the schema name into it.
    If the script is to prompt for the schema name and connect to that schema and then use that schema name inside the called sql script, then people would not be able to use it generically, as it would be reliant upon the schema name being passed in.
    It sounds as if you're trying to write one generic thing that needs to do two different tasks.
    Just have two scripts and make life simple.

  • Prepared statement problem using a field name that contains a "?"

    I am attempting to execute the following query via use of a PreparedStatement:
    select [Spread_By_Cost_Center?], Debit_Category, Credit_Category, Start_Date, End_Date, Allocation_Type From ALLOCATION_FORMULA Where FormulaID = ?
    The query fails with the following message:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT
    field incorrect
    However, I can run this query directly in MS-ACCESS, using a value for the substitution parameter (i.e., FormulaID = 1)
    If I remove the "Spread_By_Cost_Center? field from the query within the PreparedStatement, the PreparedStatement query executes successfully.
    So, it would appear that the "?" in the field name is possibly being treated as a substitution parameter. Is this a bug within PreparedStatement? I do not want to use a Statement object, as the PreparedStatement provides a much more elegant solution (when it works).
    Any suggestions?

    That may be so, but as I see it there are two alternatives:
    1. Wait for the "bug" to be fixed.
    2. Change the database to use less problematic column names.
    I know which alternative I would choose.

  • How can i get the value when the field name is user defined

    Hi,
    I have a one java method:
    public ResultSet countUserDb(String id) {
    ResultSet rs = null;
    con = dbcon.connect();
    String queryString = ("select count(*) as count from
    db_allocation where user_id='"+id+"'");
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    When i call it in a jsp file.
    ResultSet counter =db.countUserDb(request.getParameter("id"));
    if(counter.next())
    int x=rs.getInt("count");
    Tomcat said incorrect column name.How can i get the result set when the field name is user's defined.
    Best regards
    Ricky

    Hi Ricky
    To access pseudo columns you can specify an alias or use the index on the column (e.g. getInt(1)).
    Chris
    NB: you should use bind variables instead of concatenating the id to the SQL statement.

  • Accessing formula field in subreport..

    Post Author: kior
    CA Forum: Data Connectivity and SQL
    Hi,
    I'm new in Crystal report and need help on my problem "how to access the formula field i have created in subreport to my main report". Thanx in advance..

    Post Author: DubbleOh7
    CA Forum: Data Connectivity and SQL
    I haven't tested this but is should look something like this(VB.NET code)
    Dim mainreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim subreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim formulaField as FormulaFieldDefinition
    subreport = mainreport.Subreports(SUBREPORTNAME) ' Or index
    formulaField = subreport.DataDefinition.FormulaFields(INDEX OR Formula Field name)
    hope this helps.

Maybe you are looking for

  • How do I pre-render only portions of the timeline or selected clips?

    I'm switching from Vegas Pro to Premiere Pro. In Vegas, you select a portion of the timeline, then hit control-B and it pre-renders that segment. In Premiere, you hit enter, but it doesn't pay attention to the selected clips, it just pre-renders the

  • Oracle 9.2.0.1.0 installed under Redhat 7.3

    Finally beat my way through the entire process. Used command line to start the installer, OMS repository creation and OEM start. Recommend 9.2.0.1.0 Enterprise Recommend www.puschitz.com/oracleonlinux.shtml Recommend linuxquestions.org I downloaded t

  • Why can't I get this for iPhone, you don't do much for iphones

    Why isnt firefox desktop available for iPhone. ???

  • Help with "reader"

    I need to have a "reader" be able to read my pages in order.  What do I need to do to make my site read in the correct order and skip unnecessary text such as "visited link"?

  • Probability not appearing for opportunites

    We just noticed that the opportunity probability, which is based on the sales stage, is only appearing on a report if the opportunity was created by someone with the admin role. If any other roles create the opportunity, the probability % is not ther