Loop on several objects and fill Datagrid?

Hello

Any help on this would be much appreciated. I think I'm almost there.

I am new to Flex and trying to fill the datagrid from a result I get from a remote call. Basically, I have traced my result, and I see the following in the console:

[object Object], [object Object]

What is correct. So it appears I have an array of objects. I want to fill each row of the data grid with the data contained in the table.

So in my code the following is a reference to the "entire" table

trace (ApplicationState.instance.employeesArray);

I want to take this 'employeesArray' and fill in the datagrid control. Or do I assign this 'ApplicationState.instance.employeesArray' to some private var and then assign the var private to my datagrid as a supplier?

How can I do this?

Thank you

-Westside

Well, I found my own question

Adding to this as the dataprovider has worked:

dataProvider = "{ApplicationState.instance.employeesArray};

I don't know if I should convert than some other var as a private for instance, be it his market not now...

-Westside

Tags: Flex

Similar Questions

  • Insertion of several objects and check if they exist.

    Hello!

    I have this code plsql which is not working properly and should probably be written differently.

    I have up to 50 page objects (radiogroups) that gets submitted if checked, not only the number can range from 0 to 50, but also, the number of objects on the page and to submit will differ (only checked those gets submitted).

    If the code goes like this:

    BEGIN

    INSERT INTO result ('question', 'result') VALUES (APEX_APPLICATION. G_f01 (1), APEX_APPLICATION. G_f01 (2));

    INSERT INTO result ('question', 'result') VALUES (APEX_APPLICATION. G_f02 (1), APEX_APPLICATION. G_f02 (2));

    INSERT INTO result ('question', 'result') VALUES (APEX_APPLICATION. G_f03 (1), APEX_APPLICATION. G_f03 (2));

    ...

    ...

    ...

    INSERT INTO result ('question', 'result') VALUES (APEX_APPLICATION. G_f50 (1), APEX_APPLICATION. G_f50 (2));

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    NULL;

    END;

    Good everything works until the code for an object that does not exist and stops completely, as if "G_f03" exists, is not "G_f04", of "G_f05", and then 'G_f05' will not be submitted.

    Also could write this more compact and therefore he doesn't have to go through all the 50 lines? As in javascript, I can do a 'X' variable to use as a "find object" name, and then place it in a loop, like 'X = 0; Find (x);  "X++" ...


    And a newbie question: How do you want to code correctly on the forums, so it appears in a region of code?

    declare

    ins procedure (p_f apex_application_global.vc_arr2)

    is

    Start

    If p_f.exists (1) and p_f.exists (2).

    then

    insert into values of result ('question', 'result') (p_f (1), p_f (2));

    end if;

    end;

    Start

    ins (apex_application.g_f01);

    ins (apex_application.g_f02);

    ins (apex_application.g_f03);

    ins (apex_application.g_f50);

    end;

  • How to subtract a grunge texture of a layer with several objects?

    Hi all

    I've been struggling with this for hours. Would be very grateful for help.

    I'm trying to apply a vintage texture to some vector illustrations.

    In the screenshot, the work I created is in the layer of "work." I tried to simplify the work as much as possible by using the union, merge, expand, etc. I wanted to do a piece of work, but that seems so simple that I can get it.

    When I try to perform a subtraction on the layer 'work' with the layer of 'texture', basically everything disappears.

    I suspect that it does not work as expected because the layer of my work is always composed of several objects and not a unified object.

    Vintage texture superimposed on the work looks good, but I need this subtraction in vector because I intend to get it printed on a shirt in one color, so I can't get the holes filled with color.

    Any help would be greatly appreciated.

    Thank you!

    Ray

    Screenshot 2016-01-28 20.10.50.pngScreenshot 2016-01-28 20.16.20.png

    How can I activate art in a single compound path?

    First of all, to unite all paths with the first button in the Pathfinder palette. Then choose object > compound path > make (or press Command-8).

    But don't do it this way. Use an opacity mask.

    If I use the grunge texture as an opacity mask, do I still to transform the art into a single compound path first or I can do to a layer with several objects as if it were now?

    No, you have not; You can keep a complete editibility of your design. You need to just design group firstly, why the opacity mask applies to all this.

    Opacity masks are easier to use if you uncheck "Clip" after their creation. Then, all parts of the mask that is black will be transparent; each part that is white will be opaque, and the things which are shades of gray will be partially transparent. Just like in Photoshop. Right now, your grunge texture is white, so you would need to change to black after making your opacity mask.

  • Fill several objects with an image

    What's his name when I want to fill several different geometric objects with image «one»  I don't want the fill to be scaled down to fit each object.  Instead, I want to be able to see the whole picture of the research at all together to geometric shapes.  I hope it's clear. Thank you!!

    Steven Houtzager

    Steven,

    In addition to what Monika said, with a clipping mask, you must first select all of the objects and the object > Compound Path do.

    If they overlap each other, you may need a few more to operate properly; in this case, you can use the alternative of an opacity mask: select all objects turning white or black if not already, then Ctrl / Cmd + G to group them, and then in the transparency palette dialog box click the opacity with ticked Clip mask and mask invert checked (if they are black) or unchecked (if they are white).

  • I'm trying to sign several documents and I have my saved signature under "fill & sign" the organization that generated the forms highlighted the signature lines and when I try to put my signature, it is pushed outside the signature.

    I'm trying to sign several documents and I have my saved signature under "fill & sign" the organization that generated the forms highlighted the signature lines and when I try to put my signature, it is pushed outside the signature.

    Hi katepell,

    You can simply drag the signature to the desired place by holding it with the mouse.

    Thank you

    Abhishek

  • Is there a tool or function (in Illustrator or InDesign) that selects any form and 'punches' a 'hole' of this form down through several objects for the paper or the work plan?

    Is there a tool or function (in Illustrator or InDesign) that selects any form and 'punches' a 'hole' of this form down through several objects for the paper or the work plan?

    Your objects punch must be in a large group; It will cut through all that is below.

    Create the shape you want to cut and set it to black Uni. Select your group and your form and (in the transparency palette), click make mask.

    Uncheck the Clip, and then return to the palette.

  • How to draw the line under STROKE and fill of an object in illustrator cc? Ideas: D...

    How to draw the line under STROKE and fill of an object in illustrator cc? Any ideas ...

    Aleksandar,

    If I (put) understand it, you will need to divide the object. You can:

    (1) select the object and Ctrl / Cmd + C + F, and then remove the filling of the copy and the blow of the original;

    Draw 2) and drag the new piece down between Division 1 objects) in the layers palette, or select 1 copy) and Ctrl / Cmd + C + F + X + F or similar.

  • Can I define the contour of an object to be on top / face and filling on the bottom / back?

    Can I define the contour of an object to be on top / face and filling on the bottom / back?  I've asked this question before and told to go to the appearance and drag the background and outline around as if they were a layer, but this did not bring my race to the top of the image.  I did this wrong somehow, or is there another method?

    I was just thinking ' didn't I said this the other day... ". "in any case...

    This is an object with a dark gray line and a red fill. the race is in front of the filling. any random object that you draw will be the race before filling unless you tell her not to be. You can say that the race is forwards here because it extends also on each side of the framework encompassing:

    Here, the situation is reversed. Note the appearance palette. You can fill is in the front because it now covers half of the race which extends inside the frame enclosing:

    If this is not the behavior you're seeing, it's time to refer to the list of Jacob.

  • Cursor object and cursor for loop back

    I am beginner in Oracle and the serious database of programming in general. Right now I'm studying the sliders. I more or less understand how works when the cursor returns a record, but I can't understand why this does not work when the cursor return object and I use "cursor for loop.

    Here's the test code:

    CREATE or REPLACE TYPE typ_Test () AS OBJECT
    text VARCHAR2 (50)
    );

    CREATE TABLE t_Test to typ_Test;

    INSERT INTO t_Test VALUES (typ_Test('111'));
    INSERT INTO t_Test VALUES (typ_Test('222'));

    -work, simple loop
    DECLARE
    CURSOR cur IS SELECT VALUE (o) FROM t_Test o;
    typ_Test obj;
    BEGIN
    Heart OPEN;
    LOOP
    Fetch cur INTO obj;
    OUTPUT WHEN heart % NOTFOUND;
    dbms_output.put_line (obj. (Text);
    END LOOP;
    CLOSE cur;
    END;



    -doesn't work, cursor for loop
    DECLARE
    CURSOR cur IS SELECT VALUE (o) FROM t_Test o;
    BEGIN
    FOR news of obj IN LOOP
    dbms_output.put_line (obj. (Text);
    END LOOP;
    END;



    Error report:
    ORA-06550: line 5, column 30:
    PLS-00302: 'TEXT' element must be declared.
    ORA-06550: line 5, column 5:
    PL/SQL: Statement ignored
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.


    EDIT:
    In fact I found no examples on the net of its use "cursor for loop" with cursor that returns the object. Only when the record is returned...

    Published by: user10393567 on February 10, 2009 07:38

    user10393567 wrote:
    Now, in the 'loop' example for what looks "obj" is a folder, not an object, and 'x' is attribute of this recording... But the cursor must return an object, not a record... What Miss me?

    In the FOR loop "obj" is a pointer to the cursor/query, not a subject in its own right. It gives you just a reference in the query.

    So with that you are referring to the query, but then you need to refer to the column in the query that you are interested, so why there need a name (in my case I called it 'x'). 'x' is the object, and then you refer to the attribute of this object "text".

    In the first request that you simply select the value directly object in a variable, so no matter what it's called in the query values are returned by the position that is the first column in the query goes into the first variable in the INTO clause. Once you have that then the variable itself contains the object, and you can just refer to the attribute within that.

    Hope that makes sense.

  • Select several files and store in table: folder object type turns into a string?

    Hello

    I'm trying to implement the following:

    The user selects a folder (which contains subfolders) in a dialog box:

    Set Dateiauswahl = CreateObject. BrowseForFolder (0, "Verzeichnis Park", 512, mess_path)

    Folder value = CreateObject ("Scripting.FileSystemObject"). GetFolder (Dateiauswahl.Self.Path)

    All subfolders of the selected folders are listed in two variables with the overall picture:

    Call GlobalDim ("FolderList (" & Ordner.SubFolders.Count - 1 & "" ")" ")

    Call GlobalDim ("FolderPaths (" & Ordner.SubFolders.Count - 1 & "" ")" ")

    f = 0
    for each Unterordner in Ordner.SubFolders
    FolderList (f) = Unterordner.Name
    FolderPaths (f) = Unterordner
    f = f + 1

    next

    Only later the files of some of the subfolders should be stored in another file list table:

    f = 0
    for q = 0 to UBound (selection)
    Unterordner = FolderPaths (selection (q))
    Call MsgBox (Unterordner)
    For each file in Unterordner.Files
    If instr (1, File.Name, "Speed") = 0 then
    FileList (f) = File.Path
    f = f + 1
    end if
    Next

    next

    Now I seem to have a problem with the type data stored in the FolderPaths table. While Unterordner is a Folder object and must be a Folder object for each file in Unterordner.Files to work, store in the array it transformed into a string variable.

    I don't really understand why and am looking for a solution so that I can extract single table FolderPaths subfolders and then extract the files.

    Hi maliya,.

    To assign an object to an array element (or any other variable), you must use the Set syntax, like this:

    Set FolderPaths (f) = Unterordner

    Then later you can retrieve it with the same syntax:

    Set Unterordner = FolderPaths (selection (q))

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • If I have several fields and if I select a field in a drop-down list it will fill the other fields

    If I have several fields and if I select a field in a drop box is it possible to auto poplulate the other fields.

    Thank you

    Brain

    Please post your question on InfoPath 2010 at the following link

    http://social.technet.Microsoft.com/forums/en-us/sharepoint2010customization/thread/e70c23a9-1b68-4EF9-9FB4-923997043e56/

  • Table/complex objects in the Datagrid

    Hello

    I'm a complete noob to all of this, but I have a table a little complex... and I know that my paintings will get more complex.


    I can get a single line by putting it as the data provider: {dataProvider [0] ['time']}
    Or this: {dataProvider [1] ['time']}

    BUT... I want several rows in my DataGrid. I can't find a way to do this.

    Simply by putting {dataProvider} returns [object Object]... put in {dataProvider [1]} will return also [object Object]... This is provided for my dataFields are specified correctly of course for every level.

    Flash and visible in the form of objects, he barks at me to try to convert into ArrayCollection collection or anything else.

    I'm trying to make a new array even of just the dataProvider [0] ['Time'] entries by specifying newArray [0] = dataProvider [0] ['time']... etc or trying to newArray.push(dataProvider[0]['Article'])... but it is inside a function (for my remote connection) and I can't get the matrix to the public space for use in my DataGrid... or I'll get an error of not being able to make an object in a table.

    Clues? It sounds like such a simple thing... and of course, I've learned that you can't just put a loop statement inside the dataprovider... that would make super easy... so what's up?

    Thank you.

    Here is the structure of my table by the way (returned with amfphp)... which will probably not be indented, sorry.

    Table
    (
    [0] = > array
    (
    [Time] = > Array
    (
    [id] = > 1
    [created] = > 2007 - 02 - 25
    [time] = > 10
    [notes] = > hours (10)
    [project] = > 1
    [user_id] = > 1
    )
    [Project] = > Array
    (
    [id] = > 1
    [name] = > Test Project #1
    [created] = > 2007 - 02 - 25
    [reason] = > 2007 - 02 - 28
    )
    [User] = > Array
    (
    [id] = > 1
    [username] = > admin
    )
    )

    [1] = > array
    (
    [Time] = > Array
    (
    [id] = > 2
    [created] = > 2007 - 03 - 04
    [time] = > 4
    [notes] = > initial Setup page layout
    [project] = > 1
    [user_id] = > 1
    )

    [Project] = > Array
    (
    [id] = > 1
    [name] = > Test Project #1
    [created] = > 2007 - 02 - 25
    [reason] = > 2007 - 02 - 28
    )

    [User] = > Array
    (
    [id] = > 2
    [username] = > tom
    )
    )
    )

    I thought about it.
    I posted my research here: http://www.concepthue.com/how-to/cake_flex/

    Basically, I had to simplify the data coming out of CakePHP. I followed the tutorial from Mike Potter for a good bit of it.

    In my view, it is not 100% optimal, but in my view, it follows good practices on the end of CakePHP and Flex. Potentially more calls to the database can be made even if.

    I'm still not satisfied that there is no way (apparently) to format the data for use in the DataGrid inside Flex.

    Basically, I have to call data in order to create 'special' for the DataGrid control arrays. Now there is nothing special to their topic, only they are different than the charts that I will use for the rest. In fact, berries for the DataGrid are pretty useless for anything else and they are not enough descriptive - bad organization of information.

    In any case, it works. So mission accomplished, yay.

  • The call of several objects in a table

    Hello

    I tried to figure out how to appeal to several objects in a table.

    What I want to do is set the value of certain objects display in a table at certain points.

    Thus, for example;

    var CheckBox1 = this.getField("CheckBox1").value;
    var CheckBox2 = this.getField("CheckBox2").value;
    var arrObj = [
    "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"];
    
    if (CheckBox1 = "Yes") {
         if (CheckBox2 = "Yes") {
              arrObj[1].display = display.hidden;
              arrObj[7, 8, 9].display = display.visible;
              arrObj[4, 5, 6].display = display.noView;
              arrObj[2, 3].display = display.noPrint;
         }
         else if ...
              //do something else
    }
    

    So instead of writing 10 different set out I can condense up to maximum 4 or less in function.

    However, all the ways I tried to do it didn't and I can't find any clear examples on the web.

    Any suggestions?

    As always, any help is very appreciated.

    Thank you in advance.

    This is a potential problem with your code: in a table JavaScript, the first element is element 0 and not 1.

    Try this instead (it's just the inner loop):

    var a1 = [7, 8, 9];
    var a2 = [4, 5, 6];
    var a4 = [2, 3];
    
    if (CheckBox2 == "Yes") {
        arrObj[1].display = display.hidden;
        for (var i in a1)
            arrObj[a1[i]].display = display.visible;
        for (var i in a2)
            arrObj[a2[i]].display = display.noView;
        for (var i in a3)
            arrObj[a3[i]].display = display.noPrint;
    }
    
  • Best way to MouseDrag several objects around a scene.

    So I'm having a little trouble tried to drag the 3 s Box in a scene.

    Originally, I had it in place where everyone was transferred to an x, is translated Z, then assign a DRC. Then I thought that instead of the click of the mouse on the box itself, I'd be at the root. From there, I would look through all the root.getChildren (then) that see if it contained the x, position y.


    So to know who my children root I clicked on I did .setOnDragged of root.getChildren.get (current) to figure out that it was dragged.

    The code itself has worked with the exception of find which box I was.

    The question that I find, is that I only PositionX, getSceneX and getScreenX. SceneX and X produce the same value and ScreenX is useless. I then tried to do event.getX () - root.getLayoutX () contains the function works, but it did not work and would require me to change many things. getLayoutX() a = 0, since I did not indicate the location of the root, only the locations of the box.

    From there on, I was wondering if there was a better way. Then I thought maybe to loop through each element in my root or in an arrayList (which is what I used, but realized the root.getchildren should work like the original) but the problem is he keeps only save one last list, then just shut up and that's it.

    So I want to know, what would be the best way to understand what object am I?

    Initially, I use contains (Swing) but Swing is different, and as we can save mouseEvents to each node, should we not we know now exactly what we we are, while making a loop in each of them? I think it's easier than having to check each contained unique mouse position, especially if I have 10000 points to check?

    Edited by: KonradZuse March 18, 2013 20:05

    KonradZuse wrote:
    Thanks for the help!

    I can now draw a box, so there is no question about it, just that I have several boxes and I need to be able to drag each without knowing the total.

    I have 1000 boxes, or 5, I can't save a mouse to each event

    Why not?

    so I thought I would go, and then I realized after I posted this I could use the function 'Mouse_ENTERED' or 'Mouse_PRESSED' field and then move each individual, but it would still be a loop in each of them and then find who's who.

    I do not see that your example below has a certain meaning.

    I have never seen sphere.addEventHandler (MouseEvent.ANY, new DragShapeHandler()); so thank you for this tip.

    Buy it, you can also do

    DragShapeHandler handler = new DragShapeHandler();
    box.setOnMousePressed(handler);
    box.setOnMouseDragged(handler);
    

    If you prefer the convenience methods. (It is important that convey you the same reference for both).

    >

    It seems that the "DragShapeHandler" will basically get the source node and then move it? If we really do not need to know which.

    OK-ish. It uses event.getSource () to determine the source of the event (i.e., the node on which the event occurred). But you might as well set a field in the DragShapeHandler class with the node that had to be moved:

      class DragShapeHandler implements EventHandler {
    
        private double sceneAnchorX;
        private double sceneAnchorY;
    
        private final Node nodeToMove ;
    
        DragShapeHandler(Node node) {
           this.nodeToMove = node ;
        } 
    
        @Override
        public void handle(MouseEvent event) {
          if (event.getEventType() == MouseEvent.MOUSE_PRESSED) {
            sceneAnchorX = event.getSceneX();
            sceneAnchorY = event.getSceneY();
          } else if (event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
            double x = event.getSceneX();
            double y = event.getSceneY();
            nodeToMove.setTranslateX(node.getTranslateX() + x - sceneAnchorX);
            nodeToMove.setTranslateY(node.getTranslateY() + y - sceneAnchorY);
            sceneAnchorX = x;
            sceneAnchorY = y;
          }
        }
      }
    

    and then:

    ...
    box.addEventHandler(MouseEvent.ANY, new DragShapeHandler(box));
    ...
    sphere.addEventHandler(MouseEvent.ANY, new DragShapeHandler(sphere));
    

    I slightly prefer the getSource(), I think that, like the box.addEventHandler (..., DragShapeHandler (box)) new; is a little unnatural. Without doubt, however, this version is more robust (it's more type-safe because you are forced to specify a node to drag, while the source of the event could theoretically be any object).

    >

    That's a lot of sense that you're making a new node and just dragging it as such. so I can creater add a picture of the area between them and I just needed to understand the point of click, to get the box then he would know to do hmm...

    Should really "to display the box" as stated above. Just register a Manager with any node you want to be able to drag and the Manager he will drag.

  • Matching color race for several objects of different colors at the same time

    Hi people,
    I was wondering if anyone knew a way to change the stroke color to match the fill color (or add a stroke color in the case of no current line) for several objects at the same time when the objects in question have a variety of different fill colors.
    I can't seem to find a way and doubt one exists, but maybe I missed something or there is a suitable script.
    Any help much appreciated.

    Thank you. !

    (With the help of: Illustrator CC 2014 for Mac)

    try this script,

    // matchStrokeToFillColor.jsx
    // carlos canto 07/01/2014
    // https://forums.adobe.com/thread/1511792
    
    function main(){
    
        var idoc = app.activeDocument;
        var sel = selection;
    
        for (a=0; a		   

Maybe you are looking for