Search code examples
apache-flexdatagriddatagridcolumn

Flex Datagrid Column not displaying the value


We have a Datagrid:

    <nross:ScalableDataGrid id="grid" 
dataProvider="{model.practiceJoinRequestThickList.practiceJoinRequestThicks}">

    <nross:columns>
                <ui:DataGridToolTipColumn headerText="ID" dataField="practiceJoinRequest.userId"/>
                <ui:DataGridToolTipColumn headerText="Name" dataField="userName"/>
                <ui:DataGridToolTipColumn headerText="Email" dataField="userEmailAddress"/>
                <ui:DataGridToolTipColumn headerText="Office"/>
                <ui:DataGridToolTipColumn headerText="City" dataField="practice.practiceContactAddresses.address.city"/>            
            </nross:columns>

    </nross:ScalableDataGrid>

where practiceJoinRequestThicks is an ArrayCollection of PracticeJoinRequestThick object.

The PracticeJoinRequestThick has an Practice Object.

Practice has an arraycollection "PracticeContactAddresses" which is an arraycollection of PracticeContactAddress object

and PracticeContactAddress object has Address object which has the field city:String

Now when I try to display the City, it does not work. I would appreciate if someone can help me in this regard.

Thanks

Harish


Solution

  • If practiceContactAddresses is an ArrayCollection, you need to set which one you are referring to. Something like so: dataField="practice.practiceContactAddresses[0].address.city"

    Hope that helps.