How to convert an ObjectProxy Array\ArrayCollection?

Hello...

I have an ObjectProxy that I get from main system in flex, which has this structure under ResultEvent:

ObjectProxy.JPG

The objectproxy will be dynamic ie., I have 6 values of field now. Based on the inputs provided when retrieving data from the back-end system, this can vary. Next time, it could have more than 2 or 3 fields as well as those already existing.

I want to display it as a pie chart. To do this, I would need a table in this form:

ArrayCollection.JPG

Can you please help me on how to create a dynamic of this form above, table using the ObjectProxy? If not, is it possible, can I use the ObjectProxy data to display the pie chart, which is what my goal it?

Appreciate your kind help

<! -Deepak - >

Var arr:Array = [];

For (var p:String in objectproxy)

{

arr.push ({label: p value: objectproxy [p]})

}

AC = new ArrayCollection (arr);

Tags: Flex

Similar Questions

  • reclassification how to convert string into array

    Hi all


    I do the code

    CREATE OR REPLACE
    TYPE 'SAMPLE '. "" SAMPLETABLETYPEVAR ".

    PLS-00311:

    but I got to l_data error how can I solve

    /***************************************************************/
    declare
    l_str DEFAULT LONG ' pankaj/dukare /';
    l_n NUMBER;
    SAMPLETABLETYPEVAR l_data: = SAMPLETABLETYPEVAR ();

    BEGIN

    LOOP
    l_n: = INSTR (l_str, "/");
    WHEN the OUTPUT (NVL (l_n, 0) = 0);
    l_data. EXTEND;
    l_data (l_data. (COUNTY): = LTRIM (RTRIM (SUBSTR (l_str, 1, l_n - 1)));
    l_str: = SUBSTR (l_str, l_n + 1);
    END LOOP;

    L_data RETURN;

    END;

    /********************************************************/

    Published by: user9524857 on July 1st, 2009 23:36

    using your code:

    SQL> select *
      2    from table (sample_split_string ('this is a long string', ' ')
      3  /
    
    COLUMN_VALUE
    ---------------------------------------------------------------------
    this
    is
    a
    long
    string
    
  • How to convert ObjectProxy object [no one can answer this question?  :(]

    Hello

    Calling a web service with the resultFormat value e4x. When I get the result, it is in XML format. What I need is to convert it to a custom type, object of value (which is actually a class generated from WSDL). I couldn't find a way to do this. So I used a SimpleXMLDecoder to decode for a generic object. Now my problem is that all objects nested inside this generic object are of type 'ObjectProxy '. So I can't convert them my nested valuables.

    So now I finally need is one of the 2 following things:

    1. a way to convert the ObjectProxy to my custom type value object.

    Or

    2. a way to directly analyze the XML result to my type of Custom value object.

    Please let me know if I need to provide some details.

    Help, please... This one is really kill me now...

    Thanks in advance!

    I know the poster original for that matter will probably not get it, but it is not the intention of this post... I just spent the last 6 hours trying to find the answer to the question: How do I convert an ObjectProxy to my object?

    Well here is the answer for any other googlers who find this post (as it is on the first page of results for "objectproxy object cast")

    Let's say you have a service call which returns a generic object type.  "In the SOAP, you might see the xml tag resulting as.  In flex, it almost always will convert this to an ObjectProxy class.  You will find that out the object isn't exactly simple and cast to the desired type is also is no more.

    Here's how you do it, and it's actually VERY simple once you know what you need to do:

    First of all, you must convert the ObjectProxy in an object type.  To do this, you must use the namespace "object_proxy" itself.  Here's the code to do

    Import mx.utils.ObjectProxy;

    Import mx.utils.object_proxy;

    var myObjectProxy:ObjectProxy = new ObjectProxy (myStronglyTypedObject);

    var obj:Object = myObjectProxy.object_proxy::object;

    This code there will be 'myObjectProxy' and pull on the original object in a general object variable (NOTE: the reference to object is read only according to the docs.)  It is only half the battle though, as at the time, you still need to throw your object to return.  I've read in several sources that you can use a method "as MyType" to convert the object from there, but I couldn't get this to work.  Traditional molding (i.e. MyType (obj)) leads to a runtime error as well.  They can work for you if call proxy your object from an existing flex object, but will NOT work if you tire of an ObjectProxy response service.  Either way, however, the solution is just shorter to type in the case that you he shot of an intervention of service call:

    import com.adobe.serializers.utility.TypeUtility;

    obj = com.adobe.serializers.utility.TypeUtility.convertToStrongType (obj, MyType);

    (if you are unable to access this method, you should probably add the serializers.swc of the framework to your build path:)

    Adobe Flash Builder 4.5 root Directory\eclipse\plugins\com.adobe.flexbuilder.project_4.5.1.313231\dcradSwcs\4.5\libs\s erializers.swc

    This will convert your object to the type you want it to be.

    AND YOUR DONE.  No more looking for people to answer full and not more to convert your service calls to e4x instead.

    Now, if you want to know why it works but casting is not sticking around... If you don't like it, don't waste your time to read the rest of the present:

    Why that your other service calls can analyze data from a response xml SOAP at any predefined by the SOAP service, but casting this type proxy version does not work?

    Your service calls are generated dynamically from the SOAP data, then of course flex "just don't know" how to do... and your SOAP objects do not extend the object class... so what gives?

    If you look at the web service generated dynamically in flex code, you will see that each service call says what should be the result type.  Then the whole AbstractOperation (your client-side web service class) is given a convertResultHandler function that retrieves the data from the result and converts the type defined by the service.  You will not get very far just look at the code if it's away from the abstract.  But if you look at the code of serializers.swc update (you'll have to decompile it) will give you an idea of what it is that makes handler function.  Basically, this handler function takes and checks whether it is an ArrayCollection/table collection or an object and then differs from conversion of the object/table to separate the functions called 'convertToStrongType' and 'convertListToStrongType '.  These functions take a class in your object, convert it and return the past of conversion class.  Bingo.

    Now, you'll see that you can take this object and use the functions convertToStrongType and convertListToStrongType with the EFA serializers to run the conversions you need.  The advantage of this is that these functions are the SAME FUNCTIONS ACCURATE who manage the conversion of your objects in the webservice result, so you can pretty much bet that you will lose all the data like you would with reflection level unique and such utilities.

    As a side of the usefulness of this note.  If you have a c# return of web service which returns a type of list object, which means you can run in all kinds of different items in the same list, then you can use this in conjunction with a mark of the object function to determine the object type to perform conversions.

    I REALLY hope this helps some other people to save themselves from pulling their hair or lose whole days trying to figure the answer before moving on to some power of the wall facility that will make your code more complex!

  • How to convert an array of string elements to a cluster with elements named different data types?

    I'm looking for more help with the conversion of an array of elements of the chain in a cluster containing elements named different data types.

    I am importing data from an Excel worksheet.  He is coming in LabVIEW as separate (channels) 3 tables: 1) Variable name, (2) three possibilities Int, double, String) data type and the value 3), with the clues in each table corresponding to a separate variable (I have about 180 variables to import).  My ultimate goal is to convert the string array of 'Value' in a cluster.  But I want the correct data type in the cluster and I also the elements of the cluster name to match with the string 'Variable name' table so that I can use the Unbundle based on the name in my main VI.

    Please see attachment a Subvi for more details.  I did the size of the new items of tables 5 for simplicity.   I realize that labels property cannot be changed during execution and I don't think I need to do.  I just want to use the production cluster (mainly the unbundle by name) to help design my main VI.  I will need to 'read' and 'write for' the cluster during execution, but I won't need to change the names of the items.

    I was also wondering if there is a better way to import data from Excel?  Is it possible to import directly into a cluster immediately rather than put everything as strings?  I have attached a Subvi showing how I currently bring in data (found on the forum somewhere).  It comes as table 2D, which I divided into 3 separate tables that I mention above.

    I am open to any suggestion.  Thank you very much.

    -Mike

    Instead of trying to create a cluster, I think I would use only variant attributes.

  • Convert the string array to array of numbers

    How to convert an array of strings (which are numbers) to an array of numbers so I can find the maximum value? I tried to use the code below in the excerpt, but my numbers come out too much.

    It is much easier than that.

  • How to convert a table 1 d of cluster of 5 items in a table of numbers 2D? (a graph historical data)

    Hello

    in my vi, I have an array with 5 slots displaying measurement data.

    The user must be able to record all the data in the history of the card at any time. (for example the user looks at the picture and something happens, then it based on a 'save' - button)

    I know that I can read the data in the history with a property node. This isn't the problem. The problem is, how to deal with the data? The type of history data is a table 1 d of cluster of 5 elements.

    I convert these data somehow in a 2 D-table of numbers or strings, so that I can easily save it to a text file.

    How to convert a table 1 d of cluster of 5 items in a table of numbers 2D?

    I use LabVIEW 7.1

    Johannes

    Hallo Johannes,

    the photo shows the trivial way:

  • How to convert facebook in table settings

    Hello

    I looked for answers for days now and it seems that there is little support in regards to facebook api in flash. I would just ask for help regarding managing facebook params when loaded to Flash.

    I use amfphp and flash professional. I managed to get the params help

    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;

    This property returns 5 params:

    • session
    • height
    • fb_fbjs_connection
    • fb_local_connection
    • Width

    What I am interested in getting the values of session. My question is how to convert those session values in a table or how can I get the uid and the session_key?

    This is the exact return to a string:

    {"uid":"1448570087",
    "session_key":"2.LpHrIZ9IOujNzZBVf7W_Wg__.3600.1290628800-1448570087",
    "secret":"vZnL1HJsaI4QpNtqdNaYNQ__",
    "expires":1290628800,
    "access_token":"1130039|2.LpHrIZ9IZBVf7W_Wg__.30.1290628800-1448570087|B_Am374cQL-0LH4RpgRYq9Y",
    "sig":"6452254773f997495ca1b21ef3a407ef"}
    
    

    Any help would be appreciated.

    See you soon!

    Here is a quick and dirty JSON parser. She can't cover all cases, but it works with your case. It analyzes the thing you get from Facebook in an object.

    var jsonString:String = '{"uid":"1448570087","session_key":"2.LpHrIZ9IOujNzZBVf7W_Wg__.3600.1290628800-1448570087","secret":"vZnL1HJsaI4QpNtqdNaYNQ__","expires":1290628800,"access_token":"1130039|2.LpHrIZ9IZBVf7W_Wg__.30.1290628800-1448570087|B_Am374cQL-0LH4RpgRYq9Y","sig":"6452254773f997495ca1b21ef3a407ef"}';
    
    var pairs:Array = jsonString.match(/"\w+":"[\w\.\|-]+"/g);
    // create object
    var jsonObject:Object = { };
    
    for each(var pair:String in pairs) {
         pair = pair.replace(/"/g, "");;
         trace("pairs split left =", pair.match(/.*(?=:)/), "right =", pair.match(/(?<=:).*/));
         // create property from left part and assign value from the right
         jsonObject[pair.match(/.*(?=:)/)] = pair.match(/(?<=:).*/);
    }
    // check the object
    for (var prop:String in jsonObject) {
         trace("from object", prop, "=", jsonObject[prop]);
    }
    

    Tracing output is:

    pairs split left = uid right = 1448570087
    pairs split left = session_key right = 2.LpHrIZ9IOujNzZBVf7W_Wg__.3600.1290628800-1448570087
    pairs split left = secret right = vZnL1HJsaI4QpNtqdNaYNQ__
    pairs split left = access_token right = 1130039|2.LpHrIZ9IZBVf7W_Wg__.30.1290628800-1448570087|B_Am374cQL-0LH4RpgRYq9Y
    pairs split left = sig right = 6452254773f997495ca1b21ef3a407ef
    from object uid = 1448570087
    from object session_key = 2.LpHrIZ9IOujNzZBVf7W_Wg__.3600.1290628800-1448570087
    from object sig = 6452254773f997495ca1b21ef3a407ef
    from object secret = vZnL1HJsaI4QpNtqdNaYNQ__
    from object access_token = 1130039|2.LpHrIZ9IZBVf7W_Wg__.30.1290628800-1448570087|B_Am374cQL-0LH4RpgRYq9Y
    
  • How to convert a string and use a rope as a property?

    I have an array in the following format:

    {ownsCar: 'true', ownsBike: 'true', ownsHouse: 'true'}

    {ownsCar: ownsBike 'false',: 'true', ownsHouse: 'true'}

    {ownsCar: 'true', ownsBike: ownsHouse 'false',: 'true'}

    etc ............

    And I need to test against each element, for example

    If...

    myDataGrid ["myItem"] .ownsCar is object (myCheckbox) .label

    ... then

    If...

    myDataGrid ["myItem"] .ownsBike is object (myCheckbox) .label

    ... then

    If...

    myDataGrid ["myItem"] .ownsHouse is object (myCheckbox) .label

    ... then

    But I have to build my application where the property (for example 'ownsCar', 'ownsBike', 'ownsHouse') is a variable such as:

    If...

    myDataGrid ["myItem"] .myProperty is object (myCheckbox) .label

    ... then

    I would like to browse my table, by counting the number of items and then use each element as a property.

    How to convert the string (for example, "ownsCar") in a property "myProperty"?

    Thanks in advance

    Chris

    OK, if I got this right what you need to do is introspection.

    The easiest way to do this would be:

    for ( var propertyName:String in myObject ) {
         // Do what you need with this here:
         myObject[ propertyName ];
    }
    
  • How to convert pictures from iPhoto?  I need general info and advice.  My library is huge (95 GB).  I am running OSX El Capitan 10.11.6 on iMac.

    How to convert pictures from iPhoto?  I need general info and advice.  I saw the help info but I am very nervous to take on this project, as my library is huge (95GB), organized in several events and albums.  My library is saved (Time Machine SimpleSave HD).  I am running OSX El Capitan 10.11.6 on iMac.

    Have you seen this document?   Updated Photos for OS X - Apple iPhoto support

    https://support.Apple.com/en-GB/HT204655

    Is your iPhoto Library Library on your system drive in the pictures folder? And you have a lot of free space on your system drive? The migration will need additional temporary storage.

    Then drag the iPhoto library icon pictures open to create a new library of Photos of her.

    Your albums appear unchanged in the Photos.  Events will appear as additional albums, because the pictures has no events.  See this link: How Photos handles content and metadata for iPhoto and Aperture - Apple Support

  • How to convert WAV, Alac

    How to convert WAV to ALAC files.

    1. Select Apple Lossless as your chosen import format using edit > Preferences > import settings.
    2. Choose files to convert.
    3. Use file > convert > create the Version Apple Lossless.

    TT2

  • How to convert .pdf to .epub

    Please see me step by step how to convert .pdf to .epub

    Hello PrasanW.

    Thank you for using communities Support from Apple. I see your message that you want to convert PDF files into ePub files.

    Read this article.

    Creating ePub with Pages files

    Have a great day.

  • How to convert mp3 to acc in new itunes file 12.4?

    How to convert mp3 to acc in new itunes file 12.4?

    Annoydc,

    Read: Re: suddenly I can't right click to create Mp3s in iTunes.

  • How to convert audio files (many voices) to the text?

    Hello community

    How to convert file .aif audio to text?

    It contains several voice

    Thank you

    With a transcription like this service:

    https://www.tech-synergy.com/OtherServices.php

  • How to convert pdf to word

    I was sent an application form which is in pdf format. I clicked on the "edit and response" button that is displayed, but it is said that it is not supported. How to convert the pdf file to a word document so that I can add information to the document?

    There are a number of free PDF converters on the Mac App store, which allows you to convert text files, but I'm not aware of any free programs convert to Word. Besides knowing what looks like an application and how PDF conversion programs work well, I doubt that the results would be good, even if you've spent the money to buy one.

    However, if the file is not protected by, using the forecasting of Apple program, you should be able to fill out the form. Open the file using the preview, select the Tools menu and select annotate. Select the text option. A text box appears with the word TEXT in there you can change it, change the size and color and then move it to the desired location. Once you have done all of the annotations that you fill out the form, you can save it.

  • How to convert Blu Ray Disc of the movie in general video and HD video formats

    How to convert Blu Ray Disc of the movie in general video and HD video formats

    Hello

    I doubt that this is possible because Bluray discs are mostly protected against copying.
    But if you have the Bluray m2ts file on your HARD drive, then you could try the tool called convertXtodvd. But I don't see that the reasons for this
    I mean that you will lose the quality of film converting the blueray to dvd.

Maybe you are looking for

  • Tecra A11 - less than 10 ips in Skyrim on

    HelloI have a Tecra A11 i7 which came with a wiped HARD driveI installed win 7 pro and the drivers from the Toshiba site, including the pilot Intel Turbo Boost Technology. Even with all the settings set to low temperatures, vid Skyrim runs only less

  • Deployed overseas

    IM currently stationed in South Korea and I need an a dv9810us English hp recovery disk can I have one delivered to me or I can get hungal

  • Too small fonts on web pages with a computer 17 "widescreen laptop

    I have a HP Probook 4710 17 "and if I use the native screen resolution of 1600 x 900 on web pages font sizes are too small. I need to make my software demonstrations to potential customers, so it is a problem. If I play with the resolution I can do 1

  • incoming connections

    I need help about creating an incoming connection. I want to access my LAN from home office, I put a computer on the local network as a server but I do not know how to set the client connection to the House. I have not found a useful article on the t

  • I have problems setting up Windows Media Center TV Tuner to the Canada.

    I live in the Canada. I have Windows 7. I tried to set up my TV Tuner (for cable-vision, not Internet TV) in the 'Windows Media Center', but there is no "Canada" on the regional list to download my local channels. How do I pass this roadblock?