Using Nested Object Properties as DataGrid dataField

I am populating a DataGrid with an ArrayCollection of
Objects. Each of those Objects has a property that is itself an
Object. I want to use a property of the second (or "nested") Object
as a dataField for one of my columns.
Any idea how to make this work? Would a custom item render be
the only way?

Using the labelFunction property of the DataGridColumn would
be enough:
<mx:DataGrid width="100%" height="100%"
dataProvider="{myAC}">
<mx:columns>
<mx:DataGridColumn dataField="myProperty1" />
<mx:DataGridColumn dataField="myProperty2" />
<mx:DataGridColumn
labelFunction="myOwnLabel" />
</mx:columns>
</mx:DataGrid>
function myOwnLabel(item:Object,
column:DataGridColumn):String
return item.myProperty;
The function must have that signature in order to work, where
item is an instance of the objects in your dataProvider and column
is the DataGridColumn calling the function.

Similar Messages

  • Sort Nested Object - 2 properties

    Hello,
    I am trying to sort based on a few properties of an object. The only issue i am having is the properties are within a nested object.
    For example.
    I would like to stort the following object by StreetNumber and StreetName, but these properties are inside 'locations_attributes' array.
        "commute": {
            "minutes": 0,
            "startTime": "Wed May 06 22:14:12 EDT 2009",
            "locations_attributes": [
                    "StreetNumber": "12",
                   "StreetName": "Main"
                    "StreetType": "St"   
                    "StreetNumber ": "17",
                   "StreetName": "Morning Side ",
                    "StreetType": "Dr"
                    "StreetNumber ": "26",
                    "StreetName": "Blake",
                    "StreetType": "St"               
    Can this be done ?
    Drew

    I get a JSON result from a REST service and I have a custom component that I populate.
    I am not usin a datagrid, but a extended version of the List component.
    I am just trying to sort the returned result sorted by street number and street name.
    I was using a compareFunction in a sort() method, but only found samples for sorting off of one field.. not 2.
    Here is  is a sample of what I was using for 1 field.
    private function sortByAttribute(a:Object, b:Object):Object
                var x:String = a.attributes[this._activePanel.SortField].toLowerCase();
                var y:String = b.attributes[this._activePanel.SortField].toLowerCase();
                return ((x < y) ? -1 : ((x > y) ? 1 : 0));

  • Displaying properties from two objects in a datagrid

    Previously I post a discussion on this matter on Flex learning path and haven't got any response on how to do this so I figured that I might as well try again here.
    I'm using drag and drop binding in flash builder 4 on a data-grid. However, the data I need to show need to be query from another object.
    <mx:DataGrid id="dataGrid2" dataProvider="{getMajorDetailsResult.lastResult}">
                <mx:columns>
                    <mx:DataGridColumn headerText="Category Name" />
                    <mx:DataGridColumn headerText="Require Credits" dataField="requireCredits" resizable="false" width="40"/>
                </mx:columns>
    </mx:DataGrid>
    In this datagrid I bind it with an object MACL which has
    - ID
    - CAT_ID
    - requireCredits
    However, I would like to display CategoryName in the first column but categoryName is in another Object (category)
    - CAT_ID
    - CategoryName
    In this case what should I do?
    I did this so that if in the future Category Name needs to be rename. I can just rename the one in category table.
    Any help is highly appreciated.
    Thank you

    You should use a model that references the two data sources to mae the one input to the DataGrid:
    http://livedocs.adobe.com/flex/3/html/help.html?content=datamodels_3.html
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance
    www.ChikaraDev.com
    Flex Development and Support Services

  • How to upload a document with values related to document properties in to document set at same time using Javascript object model

    Hi,
          Problem Description: Need to upload a document with values related to document properties using custom form in to document set using JavaScript Object Model.
        Kindly let me know any solutions.
    Thanks
    Razvi444

    The following code shows how to use REST/Ajax to upload a document to a document set.
    function uploadToDocumentSet(filename, content) {
    appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
    hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    var restSource = appweburl +
    "/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/add(url='" + filename + "',overwrite=true)?@target='" + hostweburl + "'";
    var dfd = $.Deferred();
    $.ajax(
    'url': restSource,
    'method': 'POST',
    'data': content,
    processData: false,
    timeout:1000000,
    'headers': {
    'accept': 'application/json;odata=verbose',
    'X-RequestDigest': $('#__REQUESTDIGEST').val(),
    "content-length": content.byteLength
    'success': function (data) {
    var d = data;
    dfd.resolve(d);
    'error': function (err,textStatus,errorThrown) {
    dfd.reject(err);
    return dfd;
    Then when this code returns you can use the following to update the metadata of the new document.
    function updateMetadataNoVersion(fileUrl) {
    appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
    hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
    var restSource = appweburl +
    "/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem?@target='" + hostweburl + "'";
    var dfd = $.Deferred();
    $.ajax(
    'url': restSource,
    'method': 'POST',
    'data': JSON.stringify({
    'formValues': [
    '__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
    'FieldName': 'Title',
    'FieldValue': 'My Title2'
    'bNewDocumentUpdate': true,
    'checkInComment': ''
    'headers': {
    'accept': 'application/json;odata=verbose',
    'content-type': 'application/json;odata=verbose',
    'X-RequestDigest': $('#__REQUESTDIGEST').val()
    'success': function (data) {
    var d = data;
    dfd.resolve(d);
    'error': function (err) {
    dfd.reject(err);
    return dfd;
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How to use nested tables object in oracle form

    Hello forum
    How all r u ..
    i need ur help guys, pls help me out...
    i m using an object oriented approach to design my database by using nested tables and
    varrays. it is quite done successfully.
    but the problem is when i m trying to use that object of nested table into the datablock of the form it is not been added to item list of that block.
    so what is the proper way to use these type of objects to the form.
    all ideas are welcomed and vry much required.
    pls give example if possible so easy to understand or have any demo form related to above case then pls post me to my id i.e [email protected]
    thank u all and expecting some expert solutions

    Hello Francois Degrelle...
    How r u doing ... i have searched the forum abt the above mentioned topic then i found that u have some demo form which will help out to explain the functionality of the nested table in forms ..
    will u pls me that form to my i.e [email protected] pls mail all the detail u have regarding using nested tables to forms and reports
    lots of thanks to u n advance.

  • Nested Objects for a Data Provider in a Data Grid, not displaying data

    Hi, I have a datagrid and the dataprovider for this grid is the result of a RPC call. The result set has the following structure:
    Array
    [0]->Object #1
          [one] => 1
          [two] => 1
          [three] => Object #2
              [apple1] = > Object #3
                  [color] =>    red
                  [rate] => 20
              [apple2] => Object #4 ( the    number of apples is dynamic, apple3,apple4 .. and so on)
                  [color] =>    blue
                  [rate] => 100
    and so on ... so the number of apple objects will vary since its
    dynamic. How do I display this data in a datagrid ??? Please help!! I
    saw many articles on creating the "Nested DataGridColumn " classes...
    like this :
    http://active.tutsplus.com/tutorials/flex/working-with-the-flex-datagrid-and-nested-data-structures/
    it helps, but the problem with my data is that some of the indexes (like  apple1,apple2 etc) are dynamic.
    Also, my flex application is a desktop application (in case that matters). Just to see whats going on, I
    dropped all the nested arrays and used a plain simple one-dimensional array. Even in this case the data
    isnt getting displayed.
    I dont know what im doin wrong. the datafields, labels etc e'thing is correct. I even debugged and
    im getting the result on the flex side. whats going on ?

    No luck ... i converted the result set to a List, and even tried with an iList. Same problem -  nothing gets displayed...
    I have no idea whats happening ....
    This is my code :
    [Bindable]private var privilegesArray:ArrayCollection = new ArrayCollection();
    public function init():void{ // called on creation complete
                    RO.getPrivileges.addEventListener(ResultEvent.RESULT,handleGetPrivileges);
                    RO.getPrivileges();
    protected function handleGetPrivileges(event:ResultEvent):void{
                    privilegesArray = event.result as ArrayCollection;
    <mx:DataGrid id="privilegesDG" dataProvider="{privilegesArray}" width="100%">
            <mx:columns>
                <mx:DataGridColumn headerText="Name" dataField="name" />
                <mx:DataGridColumn headerText="Alias" dataField="alias" />
            </mx:columns>
        </mx:DataGrid>
    The data that gets returned is smthing like this : (for the moment I have removed all the nested objects and arrays and returning just a simple plain array)
    Array => [0] => Object #1
                              [name] => some name
                              [alias] => alias

  • [svn:fx-3.x] 10416: Allow null in object properties when sorting.

    Revision: 10416
    Author:   [email protected]
    Date:     2009-09-18 15:30:02 -0700 (Fri, 18 Sep 2009)
    Log Message:
    Allow null in object properties when sorting.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-13585
    Reviewer: Corey
    API Change: No
    Is noteworthy for integration: No
    tests: checkintests mustella/browser/DataGrid
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-13585
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/collections/ListCollectionView .as
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/collections/SortField.as

    Hello Sini and all-
    We've applied SP 8 and we're now able to show free characteristics only.  However, in our 3.x reports, we give our users a lot of free characteristics, so we arrange these in different navigation blocks to make thme easier to find.  So far in NW2004s, I find no way to limit specific characteristics to a particular navigation block/pane. In 3.x we use the following parameters in the Nav Item to do this:
    <param name="ITEM_NAV_BLOCK_IOBJNM_1" value="DIVREP"/>
    <param name="ITEM_NAV_BLOCK_IOBJNM_2" value="0COMPANY"/>
    <param name="ITEM_NAV_BLOCK_IOBJNM_3"value="0COMP_CODE"/>
    Please advise if you know of any way to accomplish this in NW2004s.
    Thanks,
    Ray

  • In Object Properties dialog box, modify "tab path"...

    For FrameMaker versions up to and including 8 (and I suspect 9).
    Select a graphic, then click in sequence
    ESC g o to open the
    Object Properties dialog box. By default the dialog box opens with the insertion point in the
    Width text entry area.
    Now press TAB four times: The insertion point moves sequentially to the
    Height,
    Top,
    Left, and then
    Color text entry areas.
    I wish the last movement, to the
    Color text entry area, was replaced with movement to the
    Percent text entry area. This would enable me to use the keyboard to efficiently configure the size, position, and scaling of a graphic.
    As it is, I virtually never need to select the graphic's
    Color text entry area and the movement of the insertion point to that essentially useless tool drives me crazy: It makes me TAB all the way 'round the dialog box or grab the pointing device to get it to the
    Percent text entry area...
    Cheers,
    Riley

    Odd... What does your properties dialog look like? Can you post a screenshot of the dialog box? Also, what version of LabVIEW are you running?
    Message Edited by smercurio_fc on 06-03-2008 04:56 PM

  • How to use nested tables in adobe form

    Hi All,
    I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
    EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
    item--materialdescription-ordered qty--delivered qty--delivery date-price  
    xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
    10----
    xxxxxxxxxx
    10----
    xxxxxxxxxx
    yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy 
    xxxxxx is table 1 and will have multiple lines
    yyyyyy is table 2 and will have only 1 entry for item xxx
    and this group will be repeate as per no of items. table 1 can have any no of lines per item.
    I am currently able to display 1 line for table 1 and 1 line for table 2.
    But how to show multiple lines for table 1 and 1 line for table 2.

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • Can we show the nested objects in Powershell?

    I am adding a .NET type to Powershell session using Add-Type and then creating object of that type using New-Object. This is done as follows:
    Add-Type -AssemblyName OuterObj
    $a = New-Object OuterObj
    Object of type OuterObj is successfully created. Now .NET type $a has a field named innerObj which is object of another .NET type innerObject. So I add "innerObject" .NET type and create an instance using New-Object.
    Add-Type -AssemblyName innerObject
    $b = New-Object innerObject
    Object of type innerObject is also successfully created. Now I do as follows:
    $a.innerObj = $b
    Now when I print $a, it shows something like this:
    innerObj : innerObject
    Thus it does not display the contents of innerObject by default. When I go and explore, innerObj has the fields. I know Powershell does not show the nested objects by default but instead just shows their types, but is there a way I can specify that what
    level of nesting of objects powershell should show by default? Is there something to specify to show 1 or 2 levels of nested objects?
    Any help would be highly appreciated.

    The simplest approach, if you're writing these C# classes yourself, is probably to override the class's ToString method.  That way it will just display that way by default in PowerShell, without any extra effort on the scripter's part.
    If that's not an option, then you can write PowerShell code to accomplish something similar.  Here are examples of both:
    # C# ToString version:
    Add-Type -TypeDefinition @'
    public class innerObject
    public string Property1;
    public string Property2;
    public override string ToString()
    return string.Format("Property1: {0}, Property2: {1}", Property1, Property2);
    public class OuterObj
    public innerObject innerObj;
    $a = New-Object OuterObj
    $b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
    $a.innerObj = $b
    $a | Format-List
    # PowerShell version using constructed property values with
    # Format-List.
    Add-Type -TypeDefinition @'
    public class innerObject
    public string Property1;
    public string Property2;
    public class OuterObj
    public innerObject innerObj;
    $a = New-Object OuterObj
    $b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
    $a.innerObj = $b
    $a | Format-List -Property @{ Label = 'innerObj'; Expression = { "Property1: $($_.innerObj.Property1), Property2: $($_.innerObj.Property2)" } }

  • Auto nesting objects

    Is there some way (script / plugin?) to auto nest objects on page?
    In other words, to place all objects as tight as possible to eachother.

    @Meate
    Our rip software (Wasatch Softrip) uses rectangles too. In most cases this is good enough (and allow easy cutting), but some cases where cutting isn't needed, tighter fitting would be helpful if available. See simple example in attachment.
    But like i said, i was just checking if some script existed already. If not, it's not worth writing one for the rare occasions it would be helpful.

  • Stored Proc to create XML (using nested cursors)?

    From previous posts and from the
    documentation for XSQL I have
    discovered the joys of the
    CURSOR operator to create
    nested tables: i.e:
    SELECT dname,
    CURSOR (SELECT ename, sale....) as employees
    FROM dept
    However, I can not find any other
    documentation on how to program (PL/SQL)
    this functionality.
    I would like to use XSQL as
    it is exactly what I need, but
    I can not because my client does
    not want to use Java and they
    require IIS, but do not want to
    use JRUN, etc... (I tried this
    first).
    Since I only need to do an XML
    dump to a variable for processing
    by other parts of the program, life
    is fairly easy. I have already done
    this using Microsoft Data Shapes in
    VB (client does not want VC++ either...)
    However this was slow.
    In order to speed things up I want to
    create a stored procedure in Oracle to
    dump out the XML hierarchy to a variable given
    an SQLQuery input. If I use
    nested CURSORS this should be very easy.
    I would like to create a recursive PL/SQL
    function to handle this, but I have the
    following questions:
    1) I want the function to have an
    input of an open cursor,
    My plan is to detect the column
    type, when it is a nested cursor
    I would recurse with the open cursor
    to handle the nested cursor.
    2) I can not find a reference on to
    programatically handle "untyped collections
    based on an SQL statement" in anything
    other than the XSQL documentation.
    I am assuming that I can detect the
    column type of nested cursor somehow
    and then recurse on this to handle
    dump the recordset to an XML tagset.
    But I wuold like to find some documentation
    or examples on the calls, type statements,
    etc....

    I think the CURSOR() thing is an invention of the XSQL Servlet; not available elsewhere.
    You can accomplish nesting via user defined types and object views, using the "cast(multiset())" syntax, which is not documented particularly well either. This does require some setup, and so is not particularly dynamic.

  • Unable to map actionscripting with java nested objects

    Hi Experts...,
    Im a newbie in flex and actionscripting.....
    Im unable to map nested java classes and objects with my front end flex application using actionscript....I have searched everywhere almost to my knowledge on the net but failed to find a fix...,
    im having serious trouble reffereing to attributes of an object using another object( which by the way happens to be the parent object).
    Im using hibernate and springs to do the DB transactions....,
    Please help me out with this issue.....
    Thanks for all the help and support in advance....

    Again, I don't work with Java and you should ask Java-related question in Flex (or Java) forum.
    Java or not - you need to package your server side language specific object into something that AS understands (text, XML, AMF object) and load this data into AS via, perhaps, URLLoader. Or you can open socket. Then you parse this data with AS3 code in SWF.

  • How to send nested object collection to PL/SQL Procedure as an Input param

    How to send nested object collection to PL/SQL Procedure as an Input parameter.
    The scenario is there is a parent mapping object containing a collection(java.sql.Array) of child objects.
    I need to send the parent object collection to PL/SQL procedure as a input parameter.
    public class parent{
    String attr1;
    String attr2;
    Child[] attr3;
    public class Child{
    String attr1;
    SubChild[] attr2;
    public class SubChild{
    String attr1;
    Urgent!!!
    Edited by: javiost on Apr 30, 2008 2:09 AM

    javiost wrote:
    How to send nested object collection to PL/SQL Procedure as an Input parameter.There are a few ways to do this, all of which likely depend on the particular database you're using.
    Urgent!!!Not to me...

  • DGW and using the BP Properties options confusion

    Scenario:
    I have two different document generation sets saved:
    DGW is run and save with name name1and it using BP Selection Criteria with  the BP properties button set to use "And with properties 1 checked."
    DGW is run again and save with name2 and it using BP Selection Criteria with  the BP properties button set to use  "And with properties 2 checked"
    When I then run DGW and select use existing parameter set Setname1 and go to the BP Selection Criteria and check the properties button it has properties 2 checked, where it was saved with properties1 checked.
    Is this normal behavior or am I doing something wrong?
    I am on 2007A SP0 PL42
    Edited by: Art Puliafico on May 3, 2010 6:29 PM

    You need to set the EssProperties class you created into the EssOperations class:set oEssOperations.EssProperties = <your property class instance>Alternatively, you can modify, in place, the instance of EssProperties that EssOperations already has:with oEssOperations.EssProperties .MissingTextString = "Boo!" .UseAliases = trueend withThink of the Essbase Objects Base Classes sort of as a molecule.. The 'basic atom' of the molecule is the EssOperations class (which contains the normal retrieve/zoom/pivot type of operations). Attached to the 'basic atom' are the things that are needed for a successful operation.. First, a connection (the EssConnection object) is 'plugged into' the molecule. Next, properties (an EssProperties object) is plugged in.. Finally, you need a grid to display it on so you plug in a grid object (or, more technically, one of the components that implement the IEssGrid interface).Once you have all of the 'atoms' of the grid plugged in, you have everything you need to do a successful operation.Tim TowApplied OLAP, Inc

Maybe you are looking for

  • How can i set up to see large web screen without using Ctrl++ on every website i open?

    IE can set simply chossing zoom size and I can see big enough to make my eyes relaxed for a person who has eyesight problem. Is there a way to make it to see large on every website i opened? I'm sure there is a way. Please let me know.

  • Define sender and receiver in TDMS

    TDMS experts: Immediately after I  click "define RFC destination",  I see something like MBT_Z_PRO<client#>_TST<client#>_SND. I wonder how is above string defined, i.e. how come it knows our PROD and TEST SIDs. Because the previous TDMS admin has lef

  • US Social Security withholding rate for 2012

    Hi Guys, The US Social Security withholding rate for 2012 will change to 6.2% (from 4.2%) for the employee withholding.  Our Business would be running the first payroll for 2012 on 12/22/11.  The social security withholding change needs to be in the

  • SAP MM Certification material

    Hello SAP Experts, I am planning to take SAP MM Certification exam next months. Can any one guide me where/how to get Certification material. Thank you in advance.

  • Back button in ALV oops with two screens

    hi, i have created the ALV report using oops concept. have kept the selection screen say 1000 and two more screens say 9001 and 9002. when i click on back from 9002 screen  it should go to 9001.