Dynamic binding expression to get data from array

I am retrieveing from an object to label my button as
follows:
quote:
<mx:Button label = "{wordlist.word.LABEL[0][index]}"
I now want the binding expression to be dynamic, meaning that
LABEL has to be a variable. How would I do this?
quote:
<mx:Button label =
"{wordlist.word.????[LABEL]????[0][index]}"

"lunacafu" <[email protected]> wrote in
message
news:gqte13$1g4$[email protected]..
>I am retrieveing from an object to label my button as
follows:
>
>
quote:
<mx:Button label = "{wordlist.word.LABEL[0][index]}"
>
> I now want the binding expression to be dynamic, meaning
that LABEL has to
> be
> a variable. How would I do this?
>
>
quote:
<mx:Button label =
"{wordlist.word.????[LABEL]????[0][index]}"
First, if wordlist.word.LABEL is an XMLListCollection or
ArrayCollection,
you need to use getItemAt instead of bracket notation. Once
you get to that
point, you need to cast it to whatever data type the object
at 0 is.
HTH;
Amy

Similar Messages

  • Too big switch - get data from array

    I have text file (CSV). Parse file and set data to array, e.g. ArrayList. Get data from array and initialize object MyDoc (by setXXX methods)
         for (int index = 0; index < list.size(); index++) {
                   currentElement = list.get(index);
                   switch (index) {
                   case 0:
                        myDoc.setField1(currentElement);
                        break;
                   case 1:
                        myDoc.setField2(currentElement);
                        break;
                   case 70:
                        myDoc.setField70(currentElement);
                        break;OK. But problem is that object MyDoc have many fields (70 fields). And "switch" become to big. (70 setXXX methods). Can I set fields to object MyDoc without "switch"?

    johndjr wrote:
    Just don't use a switch. It is not really helping any in this case.
    you can just do all the calls explicitly.
    Like so
    myDoc.setField1(list.get(0));
    myDoc.setField2(list.get(1));
    myDoc.setField70(list.get(69));I might convert the list to an array first simply because it seems more natural to me.
    I'm not too sure if it really matters all that much if list is an ArrayList.
    String[] values = list.toArray();
    myDoc.setField1(values[0]);
    myDoc.setField2(values[1]);
    myDoc.setField70(values[69]);you should check that toArray() call, I might not have the correct method I'm kind of doing this off the cuff.I think it is second thoughts day.
    I don't like the hard coded numbers. what I wrote should have defined constants for those values.
    static final int FLD1 = 0;
    static final int FLD70 = 69;
    String[] values = list.toArray();
    myDoc.setField1(values[FLD1]);
    myDoc.setField2(values[FLD2]);
    myDoc.setField70(values[FLD70]);
    Edited by: johndjr on Apr 17, 2009 1:33 PM
    forgot the constants

  • Get data from array in Number format

    Ive got this array with numbers in it, which i want to use for some simple calculations, but i keep getting the message that the array data isnt a number:
    The whole is in a for loop, with teller1 as increasing value.
    the code:
    var xco:Array = [180,233,271,292,292,270,231,179,124,74,34,11,9,30,70,121];
    var yco:Array = [11,33,73,124,181,232,270,290,291,271,234,183,125,72,33,11];
    for(var teller1=1; teller1<33; teller1++) {
        var ringsegment_mc:Ring_1=new Ring_1();
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);
        switch(teller1) {
         case 16:
         //kernplaats=Math.random()*600+300;
         kernplaats=Number(400);
         trace (yco[teller1]);
         trace (yco[teller1]+kernplaats);
    so the trace functions give:
    undefined
    NaN
    so i tried using this:
    trace (yco[3]);
    trace (yco[3]+kernplaats);
    which gave this:
    124
    524
    so something is going wrong when trying to read the array, but what? and how can it be fixed/

    I don't know what you are after, but if you want to use the same loop twice, then put it inside another loop... (note that arrays start at index 0, not 1)
    for(var i=0; i<2; i++){
      for(var teller1=0; teller1<16; teller1++) {
        var ringsegment_mc:Ring_1=new Ring_1();
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);
        switch(teller1) {
         case 16:
         //kernplaats=Math.random()*600+300;
         kernplaats=Number(400);
         trace (yco[teller1]);
         trace (yco[teller1]+kernplaats);

  • How to get data from hard drive in dead iMac?

    I have an old slot-loading iMac (350Mhz G3 blueberry) that just died, probably a dead power supply or something. Won't turn on at all. I don't care about restoring it, I just want to take the hard drive out and grab data from it. I've found instructions for removing the HD ... but any tips on the best/cheapest way to hook it up to get data from it? It's EIDE I believe from what I've read so far. Thanks for any help.

    Hey Richard.....Thanks for the reply to my question about my wife's dead iMac.....
    Her iMac had been acting up lately, mostly to do with her Outlook Express freezing up in OS9. I dunno if OS9 was freezing or if the application was failing. Regardless, I would have to quit OS9, restart Outlook which at the same time restarted OS9. All would be fine for a while, a day or two and then the scene would repeat itself. But I think that issue is separate from the iMac being "dead". Often we have power outages in the area, more than we should. I had the iMac plugged into a battery backup, some APS product I think it is. I believe it is only good for less than an hour as we have other devices drawing on it too. Most of our power outages are of short duration, just enough to be aggravating, sometimes having to reset clocks, etc...And a couple times, I would have to reset the time and date on the iMac so this told me that the PRAM battery was below minimum voltage. But the iMac would ALWAYS restart, even with the low battery. But the most recent outage, about one hour duration, did in the iMac, somehow or other. I do believe the battery backup basically fully discharged. So I removed the battery, could not find a new battery locally so I drove to the big city and paid the local Apple service dealer a visit. I got ripped big time price wise, embarrassed to say. So I get home, put the battery in the holder, depressed the CMU reset, the powerbutton illuminated as did a green LED by the memory modules for less than three seconds and then quit. I also heard the HD trying to spin up and a high voltage THUMP which I assume is the CRT trying to ignite. If I unplugged the iMac, removed the battery, plug in the power again and hit the power button, the iMac would repeat the same short on period and then quit. So it did not seem to make any difference if there was a battery in place. I read somewhere to pull the battery, pull the AC cord, hold down the power button to dump any current (?) and let the unit sit for 24hrs. After that length of time, I was supposed to replace the battery, depress the CMU reset, wait ten seconds and then feed it AC. Well, when I pressed the power button, I heard life for maybe five seconds, maybe a second longer, then a beep and then it shut down. I pulled the AC cord, pulled the battery, re-inserted the battery, depressed the CMU reset, waited a few seconds, plugged in the AC cord, depressed the power button and I am back at the under three seconds of "power-up" and then nothing, dead, no beep, nothing. I think maybe it is a waste of time trying to mess with this unit, looking for a newer iMac on eBay, the snowball series with the 17" LCD, might be time better spent. Hate throwing stuff away, that's why I am up to my ears in junk, maybe u know that scenario. The wife likes my 19" ACER LCD screen, hooked up to this old dual 800mhz, though she dislikes the noise and the tower. But we both agree the large LCD screen is much easier on our aging eyes than the old iMac CRT. Anyway, I appreciate your help, always GREAT to correspond with an Apple fan.....John Bauer

  • Help needed with variable - trying to get data from Oracle using linked svr

    Sorry if I posted this in the wrong forum - I just didn't know where to post it.
    I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
    Here's how I would get the variable in SQL:
    declare @maxkey INTEGER
    select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
    select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
    the select statement I need to do in oracle would use that variable like this:
    select * from OPENQUERY(OracleLinkedServer,'select
    * from ORACLEDB.TABLE where keyfield > @maxkey')
    and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
    I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • How to get data from subsites list of SharePoint 2010 in ssrs

    Hi,
    Can someone help me on this issue.
    I want to create a report using ssrs, I have some of the data in SQL and some of the data in sharepoint list.
    First I need to go to SQL and get the data from the table which contains URL for the subsite in sharepoint.
    after that I need to go to all the subsites and go to perticulat list in the subsites and get data from that list.
    for example, their is a top level site "abc"
    it contains sub site "123", "456","567", etc.. All this sub sites contain a list by name "Sample List", Now I need to go to that sub site list(Sample List) and get list-item column say "created By" which
    is created on particular date. 
    in my report, I need to print the sub site "url/Title" which comes from SQL database and list-item column  "Created By" of that sub site list "Sample List".
    I tried using subreport inside a report by using "Microsoft SharePoint List" as a datasource, but when it comes to real time we don't know how many subsites will be created, so we can't create a datasource for each subsite site.
    I guess we need to be using XML as a datasource, but how can we go to particular subsite in query while using XML, since all subsites have list with the same name ?
    I appreciate your help.
    Thank you,
    Kishore 

    Hi Kishore,
    SQL Server Reporting Services(SSRS) supports expression-based connection strings. This will help us to achieve the goal you mentioned in this case:
    Create a new report
    Create a Data Source in the report with the connection string like this:
    http://server/_vti_bin/lists.asmx (We use static connection string instead of expression-based connection string now, as it is not supported to get fields based on expression-based connection string in design time. We will change it to be expression-based
    connection string later)
    Create the data set(as you have done using XML query language). Please use list name instead of GUID in the listName parameter.
    Design the report(e.g. Add controls to the report)
    Now, let's change the connection string to be expression-based. First, please add a parameter to the report, move this parameter to top. This parameter is used to store the sub site name.
    Open the Data Source editor, set the connection string to be: ="http://server/" & Parameters!parameterCreatedInStep5.value & "_vti_bin/lists.asmx"
    In the main report, pass the sub site name to the report we created above via the parameter created in step5
    That is all.
    Anyway, this is actually a SQL Server Reporting Service(SSRS) question. You can get better support on this question from:
    http://social.technet.microsoft.com/Forums/en/sqlreportingservices/threads
    For more information about Expression-Based connection string, please see:
    http://msdn.microsoft.com/en-us/library/ms156450.aspx#Expressions
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jinchun Chen
    Jin Chen - MSFT

  • How do i get data from a structure using join?

    hi,
    what is the actual use of a structure.?
    my problem is :
    KUAGV is an existing STRUCTURE. it has got one fields each which links to MARA, AND VBKD tables. i want to fetch all related information from KUAGV, mara, vbkd . which is the better way : using joins or views or anything else? how do i
    get data from a structure using join?

    structure temporarily holds  any data passed to it dynamically throughout the runtime but doesnot store it permanently. so
    a structure cannot be included in a join.so instead of incuding structure KUAGV's field in a join 
    search the transparent table in which same field are present and  use it in join.
    A structure if created in DDIC(Data Dictionary) is a global DATA STRUCTURE which is used to group related information, for example you would group all the details of your bank account into a structure BANK_ACCOUNT that contains fields like account_Id, account_holder_name etc.
    If you create a structure in your program then it is local to your program. So you use this structure to create data holders of this DATA TYPE to hold data in your program.
    Edited by: suja thomas on Feb 11, 2008 6:24 AM
    Edited by: suja thomas on Feb 11, 2008 6:31 AM

  • Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012

    Hi,
    I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX query vs a
    Tabular model?
    In the TechNet documentation, this event class is handled briefly.
    Thanks

    Hi pscorca,
    This event is raised when the storage engine reads data from an aggregation, it may have a negative impact on performance when turned on. If you need to monitor SSAS instance status, we can also use dynamic management view:
    Use Dynamic Management Views (DMVs) to Monitor Analysis Services:
    http://msdn.microsoft.com/en-us/library/hh230820.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • Giving dynamic sheet name while importing data from Excel in OPENROWSET query

    I want to import data from Excel to table in SQL server. Sheets in Excel file can have any name. I want to get data from first sheet of the excel file. 
    CREATE PROC CopyExcelDataToTempTable
    @ExcelPath VARCHAR(1000)
    AS
    BEGIN
    EXEC sp_configure 'show advanced options', 1;
    RECONFIGURE;
    EXEC sp_configure 'ad hoc distributed queries', 1;
    RECONFIGURE;
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1;
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1;
    INSERT INTO TempData
    SELECT *
    FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
    SELECT CONCAT('Excel 12.0 Xml;HDR=YES;Database=', @ExcelPath),
    'SELECT * FROM [Sheet1$]');
    END;
    Currently I am giving Sheet1 as static name in Select statement. But my sheet name is not fixed. I want to create a dynamic query. If getting Sheet name is not possible then can we put sheet with its index in Select query? There is no front end. Whatever I
    want to do is in SQL server 2012. Is there any solution for this problem?

    Hi Ajinkya,
    To get the sheet names from an excel, you can use the Stored Procedure
    SP_TABLES_EX. See the below code.
    EXEC sp_addlinkedserver 'ExcelSource', '',
    'Microsoft.ACE.OLEDB.12.0',
    'c:\worksheet.xls',
    NULL,
    'Excel 8.0'
    EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false'
    GO
    EXECUTE SP_TABLES_EX 'ExcelSource'
    the names in the worksheet.xls and execute result are like below.
    Table name
    a
    b
    c
    d
    Regarding your description, you need the first sheet of your excel. As the result shows, the sheet names are sorted, so there’s no guarantee to get the first one. The SP can work as a workaround when there’s only one sheet in your excel or the required sheet’s
    name is customized to be sorted at the top first.
    If you have any question, feel free to let me know.
    Best regards,
    Eric Zhang

  • How to get data from php to java via xmlrpc

    I have been trying to get data from php through apache xmlrpc to java.
    I do get an value as result. The result is "Array". How how do i convert the XMLRPC Object "Array" to Java Object?
    Inside the XMLRPC "Array" Object there is object too of type Array from php.
    See code for java here
    Object result = client.execute( "blogger.getCategories", params1 );
    Code from php here
    function getCategories($appkey, $username, $password)
         global $xmlrpcerruser, $xmlrpcI4, $xmlrpcInt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue;
         $structArray = array();
         $structArray[] = new xmlrpcval(array("one" => "test"));
         return new xmlrpcresp(new xmlrpcval( $structArray , $xmlrpcArray));     
    I do get Standard String and Integer from php to Java through XMLRPC.
    Can someone help me.
    Edited by: Electron32 on Aug 13, 2010 9:44 AM

    That is what is so strange. I return an 'array' through xmlrpcval() and in Java I tried to cast it to ArrayList, Vector,String[] but get an error
    Object[] result = (Object[]) client.execute( "blogger.getCategories", params1 );
    String[] array = (String[]) result;
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
            at com.dirdalit.window.Main.main(Main.java:41)
    Edited by: Electron32 on Aug 13, 2010 12:25 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Dynamic Internal Table for reading data from external file

    Hello All,
    The task was to create a internal table with dynamic columns,
    Actually this is my first task in the WebAS 6.20, my program is based on input file provided by user with certain effort. this file can have different effort for a one yr to five year frame..
    I needed to read the raw data from file, based on months create a internal table to hold the data, after this i need to validate the data...
    I have browsed thru dynamic internal table topic, but couldn't find any dynamic appending structure, the dynamic structure would contains 12 month fileds.
    can any one help me in getting my task completed..
    Thanks
    Kumar

    Hi,
    I see that you posted the same question a couple of days ago at Dynamic Internal Table for reading data from external file Didn't Charles's response address your problem?
    Regards

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

  • Funds management cube getting data from 4 ods, data not seen in cube

    Hello all,
    I am working on funds management cubes (0PU_C02 and 0PU_C03). These two cubes get data from like 7 or 8 ODS. Can someone tell me which are the ODS which feed to respective cubes. I have the mappings done but i am getting very confused.
    In the ods 0PU_O44 there is RLDNR for Ledger and I can see that data in ODS but when i run load to cube I dont see the ledger data (its direct mapping there are no routines or rules).
    Is there any sequence with wihic we have to load the data?
    Thanks
    Message was edited by: Raj M

    Hi Raj,
    I was going thru the forums who has knowledge in Public sector when i came accross ur forum.Can i get your email id..i have some questions to ask regarding student administration.
    thanks.

  • Powerpivot Error on Refresh -- "We couldn't get data from the data model..."

    I'm using Excel 2013 and Windows 8.1.  I have a spreadsheet I've been using for over a year, and I've just started getting this error message when I try to refresh the data.
    "We couldn't get data from the Data Model.  Here's the error message we got:
    The 'attributeRelationship' with 'AttributeID' - 'PuttDistCat9' doesn't exist in the collection"
    Any idea how I can fix this problem?  I haven't changed anything related to that particular attribute.  All the data is contained in separate sheets in the workbook, so there are no external sources of data.
    Thanks.
    Jean

    Thanks for all the suggestions.
    I found a slightly older version of the spreadsheet that still refreshes properly, so I don't think I have any issues with the version of Excel or Power Query.  (I've had this same error before, and I believe I applied the hotfix at that time.)
    I think this problem started after I updated a number of the date filters in the pivot tables.  I haven't made any changes to the data model, and the only updates I've made were to add data (which I do all the time), and to change the date filters on
    the pivot tables.
    As suggested, I added a new pivot table querying one table (the table with the attribute that shows up in the error message), and it worked fine.  I can also refresh this pivot table.
    Then I tried adding a pivot table which went against several tables in the data model (including the table in question).  The pivot table seemed to return that data properly.  However, when I tried to refresh it, I got the same error message ("we
    couldn't get data from the data model..."). 
    Dany also suggested running the queries one at a time to see which one is in error.  Without checking all the pivot tables, it appears that any which use the table "HolePlayedStrokes" generate the error (this is the table with the attribute
    mentioned in the error message).  Pivot Tables without that particular table seem to refresh OK.  Unfortunately, that is the main table in my data model, so most of the pivot tables use it.
    Any other suggestions?  I'd be happy to send a copy of the spreadsheet.
    Thanks for all the help.
    Jean

  • Get date from Oracle when local time zone is different from Oracle time zon

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send e.g. 28.06.2002, but in Oracle date is save as 27.06.2002 01:00 (hour=01 , I suppose that is because java.sql.Date hasn't time the Oracle set it time = time zone=+1) And when I get date from Oracle I get incorrect date. In SQL I don't use date masks. Maybe solution is to use java.sql.Timestamp object (when save date to Oracle) instead of java.sql.Date?
    But if I save date at e.g. 01:00 clock and send e.g. 28:06.2002 in Oracle, date is save as 28.06.2002 01:00 and when I read from Oracle I get correct date.
    Thank you.

    Hi!
    Local machine time zone= +2
    Oracle time zone= +1
    I set date to Oracle using java.sql.Date.
    From application I save date at 00:30 clock and send
    e.g. 28.06.2002, but in Oracle date is save as
    27.06.2002 01:00 (hour=01 , I suppose that is because
    java.sql.Date hasn't time the Oracle set it time =
    time zone=+1) Presumably you are using setTimestamp() to store the value. If you are explicitly using a varchar (string) then you will have to correct the timezone your self.
    And when I get date from Oracle I get
    incorrect date. In SQL I don't use date masks. Maybe
    solution is to use java.sql.Timestamp object (when
    save date to Oracle) instead of java.sql.Date?The method setDate/getDate store a 'date' which is not the same as a 'date and time' for which setTimestamp/getTimestamp are used.
    But if I save date at e.g. 01:00 clock and send e.g.
    28:06.2002 in Oracle, date is save as 28.06.2002
    01:00 and when I read from Oracle I get correct date.
    Thank you.

Maybe you are looking for

  • Using a CWM format XML as datastore; COM SDK to read the file and create Universe

    Hello everyone We are in the process of migrating from a metadata store to BusinessObjects Universe and the plan is to use Java/COM SDK to accomplish that. We have run into limitations with both the SDKs. Java SDK doesn't provide that facility and us

  • Internet load sharing

     Hi,  I want to load share traffic for my two network segments. I have two routers with each internet circuit running BGP with two different ISPs(ISP- A & ISP-B). Also running IBGP between two routers. Since i have two /24 segments(not provided by IS

  • Left outer join functions like simple join

    I created two views SCO_REQGROSSLINES_V & SCO_REQLINESCOMPLETE on Oracle requisitions base tables. Our business rules enforce the following identity: the number of gross requisition lines will always be greater than or equal to the number of requisit

  • Adding new filter column in customised report

    Hi, I want to add a new value to the filter list in one of our customized report. Afther the report is generated in Admin UI, at the top of the report's page, I want that business users can filter the report by giving the value of the filter column a

  • OWB page problem

    I am new to OWB and I am getting errors from the links off of http://www.oracle.com/technology/products/warehouse/htdocs/OTN_demo.html "An error occurred while processing the request. Try refreshing your browser. If the problem persists contact the s