How to get static attribute using it's name as a string

I have an app with about 100 unique combo boxes (it's a gov't requirement, I'm not that bad a designer ) and I would like to define all the choices in a single separate file like this:
package components {
import mx.collections.ArrayCollection;
    public class Choices    {
  [Bindable] public static var A0310A:ArrayCollection = new ArrayCollection ( [
                                      { value:"01", label:"Admission"},
                                      { value:"02", label:"Quarterly" },   
                                 ........snip ..
                                      { value:"99", label:"NOT OBRA Required" }]);
          public static function getChoices(name:String):ArrayCollection {
              var temp:ArrayCollection = ????????????????
              return temp;
    }//----------------end of class--------------------------------
}//======================== end of package==============================
I want to use it like this
<my:ComboBox id="mdscombo" tag="A0310A" />
Where the definition of my:ComboBox includes code like this
             var zz:ArrayCollection = Choices.getChoices(name);
but I cannot find any function that will let me do this.  I really don't want to clutter the code by creating a name->object lookup table.
I had also considered using the XML data type but I would have the same issue unless I had all the choices under a single root (possible) but that could be a nightmare in debugging typo's in the XML.
Any suggestions???

The technique you describedd worked perfectly.
I've yet to deploy my first production app in Flex, so I would appreciate what you see in my approach that is "not desireable"  If I'm heading down a bad path I would like to know while I can still refactor.

Similar Messages

  • How to Get static attributes dynamically

    Hi,
    I have to get static attributes from the context dynamically is it possible?
      DATA node     TYPE REF TO if_wd_context_node.
      DATA element  TYPE REF TO if_wd_context_element.
      node = wd_context->path_get_node( path = path_node ).
      element = node->get_element( ).
      element->set_static_attributes( static_attributes = ??? ).
    Thank you in advance.
    Miguel

    Hi ,
    i would suggest to use CL_ABAP_STRUCTDESCR
    cl_abap_typedescr=>describe_by_data

  • How to get data by using only file name in XI

    Dear All.
           I have 2 senarios . How can I configure it in the Configuration?
    1. get data from file name (xxx.txt) --> HTTP
    2. convert data into text file            --> File
    Thak you in advance.
    Au

    dnt think so?, using a webpage to send the file to XI, you will sending data again to XI as a file, pls tell what is the puropose of using the webpage to copy file?
    is this webpage only used to move the file from one loaction to other from which the XI can acess?
    to which location this file is placed? if XI reads this file from somelocation then you do as relied in above use filesender adapter and do FCC then.....

  • How to get Tablename by using only Column Name in Schema?

    Hi,
    Here I need a small information. I am looking for the TableName based on Column Name.
    I know the Column name but not in which Table that Column belongs? So is there any way to look the Table Name by giving Column Name as an Input parameter in Oracle Schema.
    If anybody have the answer please help me out.I appriciate your help.
    Thanks,
    Srikanth Kondeti

    Srikanth,
    The three data dictionary views:
    <ol>
    <li>USER_TAB_COLUMNS</li>
    <li>ALL_TAB_COLUMNS</li>
    <li>DBA_TAB_COLUMNS</li>
    </ol>
    Contain both the column name and the table name (among other things).
    More information can be found in the Oracle documentation, in particular the Oracle Database Reference.
    All Oracle documentation can be accessed from here:
    http://www.oracle.com/technology/documentation/index.html
    Good Luck,
    Avi.

  • How to get zclass attribute's value inside  "Execute_default" method

    Hi all,
    I am displaying a link in UD step under "Objects & Attachmnents".I am using zclass. I created a attribute in zclass and i am creating a instance (background task) before this UD step and i will be setting a attribute of the zclass inside this create instance method.
    My problem is, if i click the link, this method "BI_OBJECT~EXECUTE_DEFAULT_METHOD" is getting executed but i am not able to get the attribute value inside this method, eventhough i am setting the attribute value before the UD step.
    Pls let me know, how to get the attribute's value inside "Execute_default" method, as i need to process further using this attribute.
    P.S: I tried with both static & instance attribute. I can achieve the same using ZBO but my client needs to use only class.
    -Vinoth
    Edited by: S Vinoth on Jan 29, 2010 7:23 AM

    Lei,
    If you are concerned only about a couple of attributes, then you can manage with a separate copy of the data. But if the data is in bulk, better leave it to pl/sql side of validation.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to Get Navigational attributes of dso in Report ...

    Hi i have a dso with many fields ,
    In the report i need to get some navgational attributes which are in dso..
    How to Get Navigational attributes of dso in Report ..??
    Thanks All..

    hai naiduz,
    in the dso u find folder with navigational attributes, there select the Navigation check box the fields which u need in the report.
    and further if ur dso through multiprovider and also identify them at multi provider level.
    then u will be able to see the fields at query designer level, then u can use the nav. fields u need in the report.
    regards,
    Vj

  • How to get the attribute value of an XML file??

    How to get the attribute value of an XML file??
    For example, how to get name and age attributes?
    <student name="Joe" age="20" />

    What are you using to read the XML file??
    On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
    Document doc = builder.build(filename);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Element thisElement = (Element)children.get(n);
    String name = thisElement.getAttributeValue("name")
    try
         int age = Integer.parseInt(thisElement.getAttributeValue("age"));
    catch (Exception ex)
         throw new InvalidElementException("Expected an int.....");
    }Ben

  • How to get the attribute values out?

    Hi everyone,
    <root>
    <category name="Mens Clothing" id="0">
    <subcategory>Active/Baselayer Tops</subcategory>
    <subcategory>Active/Baselayer
    Bottoms</subcategory>
    </category>
    <category name="Womens Clothing" id="1">
    <subcategory>aaa</subcategory>
    <subcategory>bbb</subcategory>
    </category>
    </root>
    How to get the attribute values out? For example "Mens
    Clothing" and "Womens Clothing".
    // the line below returns "Active/Baselayer Tops" and
    "Active/Baselayer Bottoms"
    var myXml:XML = new XML(event.result);
    Thanks,
    May

    Here is attribute identifier operator from FB Help:
    @ attribute identifier Operator
    Usage myXML.@attributeName
    Identifies attributes of an XML or XMLList object. For
    example, myXML.@id identifies attributes named id for the myXML XML
    object. You can also use the following syntax to access attributes:
    myXML.attribute("id"), myXML["@id"], and myXML.@["id"]. The syntax
    myXML.@id is recommended. To return an XMLList object of all
    attribute names, use @*. To return an attribute with a name that
    matches an ActionScript reserved word, use the attribute() method
    instead of the @ operator.
    Operands attributeName:* — The name of the attribute.
    Example
    How to use examples
    The first example shows how to use the @ (at sign) operator
    to identify an attribute of an element:
    var myXML:XML =
    <item id = "42">
    <catalogName>Presta tube</catalogName>
    <price>3.99</price>
    </item>;
    trace(myXML.@id); // 42The next example returns all attribute
    names:
    var xml:XML =<example id='123' color='blue'/>
    var xml2:XMLList = xml.@*;
    trace(xml2 is XMLList); // true
    trace(xml2.length()); // 2
    for (var i:int = 0; i < xml2.length(); i++)
    trace(typeof(xml2
    )); // xml
    trace(xml2.nodeKind()); // attribute
    trace(xml2
    .name()); // id and color
    } The next example returns an attribute with a name that
    matches a reserved word in ActionScript. You cannot use the syntax
    xml.@class (since class is a reserved word in ActionScript). You
    need to use the syntax xml.attribute("class"):
    var xml:XML = <example class='123'/>
    trace(xml.attribute("class"));

  • How to get multiple records using fn-bea:execute-sql()

    Hi,
    I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
    Regards,
    Nagaraju
    Edited by: user10373980 on Sep 29, 2008 6:11 AM

    Hi,
    Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
    For example:
    fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
    Id Name
    01 XXX
    02 YYY
    03 ZZZ
    I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
    <student>
    <Name>XXX</Name>
    </student>
    I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
    Please suggest.
    regards,
    Venkat

  • How to get iccid by using imei?i had lost my iphone and i want to find it back.

    how to get iccid by using imei?i had lost my iphone and i want to find it back.

    Ocean20 wrote:
    Not sure about ICCID but you can get your IMEI by going to the computer you normally sync to and open iTunes there click on edit then preferences then on the devices tab and then hover mouse over your backup and the IMEI and other info on your phone will appear
    Interesting. Yet another of the many Easter eggs dispersed throughout the system.

  • How to get the workcentres used in the routing out of 2 alternate routings

    Dear All,
    I would like to know how to get the workcentres used in the routing out of 2 alternate routings.
    I referred PLKO got the Task List Type (PLNTY), Group(PLNNR), Group Counter(PLNAL), Plant(werks).
    I passed this in to PLPO, The problem in PLPO is we don’t have the distinguishing field Group Counter(PLNAL), so I am getting all the ARBID including both alternates.
    How to get the ARBID with respect to Groupcounter 1 alone.
    If a get the ARBID , I can get the ARBPL from CRHD.

    HI,
    Use PLAS Table also.  you have to use PLKO> PLAS> PLPO.
    Pass PLNNR & PLNAL in PLAS and get PLNNR & PLNKN.
    Then pass these into PLPO.
    work centers from CRHD
    Regards,
    Krishna Mohan
    Edited by: Krishna Mohan N on Jan 31, 2008 12:28 PM

  • How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    Ok what about If i need to get all important attributes by comparing Email addresses from excel file and get all required answers
    currently I am trying to verify how many users Lines are missing , Emp numbers , Phones  from AD with HR list available to me.
    I am trying to Scan all the AD matching HR Excel sheet and want to search quickly how many accounts are active , Line Managers names , Phone numbers , locations , title , AD ID .
    these are fields I am interested to get in output file after scanning Excel file and geting reply from AD in another Excel or CSV file
    Name’tAccountName’tDescri ption’tEma I IAddress’tLastLogonoate’tManager’tTitle’tDepartmenttComp
    any’twhenCreatedtAcctEnabled’tGroups
    Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,Title,Department,Company,whenCreated,Enabled,MemberOf | Sort-Object -Property Name
    Can you modify this script to help me out :)
    Hi,
    Depending on what attributes you want.
    Import-Module ActiveDirectory
    #From a txt file
    $USERS = Get-Content C:\Temp\USER-LIST.txt
    $USERS|Foreach{Get-ADUser $_ -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    #or from a csv file
    $USERS = Import-CSV C:\Temp\USER-LIST.csv
    $USERS|Foreach{Get-ADUser $_.SAMAccountName -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    Regards,
    Dear
    Gautam Ji<abbr class="affil"></abbr>
    Thanks for replying I tried both but it did not work for me instead this command which i extended generated nice results
    Get-ADUser -Filter * -Property * | Select-Object Name,Created,createTimeStamp,DistinguishedName,DisplayName,
    EmployeeID,EmployeeNumber,Enabled,HomeDirectory,LastBadPasswordAttempt,LastLogonDate,LogonWorkstations,City,Manager,MemberOf,MobilePhone,PasswordLastSet,BadLogonCount,pwdLastSet,SamAccountName,UserPrincipalName,whenCreated,whenChanged
    | Export-CSV Allusers.csv -NoTypeInformation -Encoding UTF8
    only one problem is that Manager column is generating this outcome rather showing exact name of the line Manager .
    CN=Mr XYZ ,OU=Users,OU=IT,OU=Departments,OU=Company ,DC=organization,DC=com,DC=tk

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How to get last column used in report sorting?

    hi,
    how to get last column used in report sorting?
    simon

    How to identifiy which column was sorted having different reports on page?
    just use:
    'YOUR_STATIC_REGION_NAME' instead of p_static_id,
    :APP_ID for p_app_id,
    :APP_PAGE_ID for p_page_id
    :APP_USER_ID for p_app_user.
    and dont forget to grant SELECT on #OWNER# to APEX_030200.WWV_FLOW_PREFERENCES$
    good luck and thank you Juergen.Schuster
    Simon

  • How to get Listener Information using PL/SQL code

    How to get Listener Information using PL/SQL code

    user2075318 wrote:
    How to get Listener Information using PL/SQL codeThis approach (somewhat of a hack) can be used - but it does not really provide meaningful data at application layer.
    SQL> create or replace function TnsPing( ipAddress varchar2, port number default 1521 ) return varchar2 is
      2          type THexArray is table of varchar2(2);
      3          --// tnsping packet (should be 10g and 11g listener compatible)
      4          TNS_PING_PACKET constant THexArray := new THexArray(
      5                  '00', '57', '00', '00', '01', '00', '00', '00',
      6                  '01', '39', '01', '2C', '00', '00', '08', '00',
      7                  '7F', 'FF', '7F', '08', '00', '00', '01', '00',
      8                  '00', '1D', '00', '3A', '00', '00', '00', '00',
      9                  '00', '00', '00', '00', '00', '00', '00', '00',
    10                  '00', '00', '00', '00', '00', '00', '00', '00',
    11                  '00', '00', '00', '00', '00', '00', '00', '00',
    12                  '00', '00', '28', '43', '4F', '4E', '4E', '45',
    13                  '43', '54', '5F', '44', '41', '54', '41', '3D',
    14                  '28', '43', '4F', '4D', '4D', '41', '4E', '44',
    15                  '3D', '70', '69', '6E', '67', '29', '29'
    16          );
    17 
    18          socket  UTL_TCP.connection;
    19          txBytes number;
    20          rxBytes number;
    21          rawBuf  raw(1024);
    22          resp    varchar2(1024);
    23  begin
    24          socket := UTL_TCP.open_connection(
    25                          remote_host => ipAddress,
    26                          remote_port => port,
    27                          tx_timeout => 10
    28                  );
    29 
    30          --// convert hex array into a raw buffer
    31          for i in 1..TNS_PING_PACKET.Count loop
    32                  rawBuf := rawBuf || HexToRaw( TNS_PING_PACKET(i) );
    33          end loop;
    34 
    35          --// send packet
    36          txBytes := UTL_TCP.write_raw( socket, rawBuf, TNS_PING_PACKET.Count  );
    37 
    38          --// read response
    39          rxBytes := UTL_TCP.read_raw( socket, rawBuf, 1024 );
    40 
    41          UTL_TCP.close_connection( socket );
    42 
    43          --// convert response to varchar2
    44          resp := UTL_RAW.Cast_To_Varchar2( rawBuf );
    45 
    46          --// strip the header from the response and return the text only
    47          return( substr(resp,13) );
    48  end;
    49  /
    Function created.
    SQL>
    SQL> select tnsping( '10.251.93.30' ) as TNSPING from dual;
    TNSPING
    (DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=0)(ALIAS=LISTENER))
    SQL> select tnsping( '10.251.95.69' ) as TNSPING from dual;
    TNSPING
    (DESCRIPTION=(TMP=)(VSNNUM=0)(ERR=0)(ALIAS=LISTENER))
    SQL>

Maybe you are looking for

  • GarageBand substituting earlier versions of clips as I add them

    I haven't used GarageBand 3.0.5 (104.10) to record real instruments yet. What I've been doing is building up Mash-Ups, or sample-pieces. One or 2 tracks for the backing tracks, then individual tracks for each volume level and effects where I drop in

  • Nokia 6220 classic help

    anybody know how to get the bluetooth working properly any software going about or not thanks

  • How to use variables in DVM

    I have a string variable called codeValue and I want to use it in a dvm:lookupValue. Do you know how to use a variable in a dvm function? Below is my lookup function but I got an XPath error dvm:lookupValue ('cityMap.dvm','Code',codeValue,'CityNames'

  • Method to expand a particular node in a HGrid

    I have an enhancement where I create a child node under a parent node in a HGrid and once I create the child and come back to the Grid page I need to see the parent node expanded and child node visiible. By default the parent node is collapsed as a r

  • Need information for writing 1Z0-147 exam

    hi gurus, I am going to write 1Z0-147 Exam. Can any body please share the information related to 1Z0-147 exam. thanks in advance...