• Aishwarya Kotabagi
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I am not able to display the iteration details for the third time 
this is my component class:
<table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_striped">
.......
<tbody>
                <aura:iteration items="{!v.ResponseObj.customers}" var="cus">
                    <tr>
                        <th scope="row">
                            <div class="slds-truncate" title="{!cus.line_of_business}">{!cus.line_of_business}</div>
                        </th>
                        <aura:iteration items="{!cus.contacts}" var="cus1">
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.name}">{!cus1.name}</div>
                            </th>
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.home_phone}">{!cus1.home_phone}</div>
                            </th>
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.email}">{!cus1.email}</div>
                            </th>
                            <aura:iteration items="{!cus1.address}" var="cus2">
                                <th scope="row">
                                    <div class="slds-truncate" >{!cus2.street}</div>
                                </th>
                            </aura:iteration>
                        </aura:iteration>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
this is the nested class that I am trying to display:
public class JSON2Apex{
    public String request_tracking_id;	//12
    @AuraEnabled public cls_customers[] customers {get;set;}
    public cls_metadata metadata;
    public class cls_customers {
        public String id	{get;set;}//000131417543005
        public String status {get;set;}	//CANCELLED
        public String category {get;set;}	//OPEN MARKET
        @AuraEnabled public String line_of_business {get;set;}	//COMMERCIAL
        public String account_type {get;set;}	//master
        public String is_national_account;	//False
        public String is_central_billed;	//False
        @AuraEnabled public cls_contacts[] contacts {get;set;}
        @AuraEnabled public cls_wm_metadata wm_metadata {get;set;} 
    }
    public class cls_contacts {
        public String type {get;set;}	//service
        public String organization_name {get;set;}	//SAWRIDGE HOTEL
        @AuraEnabled public String name {get;set;}	//VIPUL
        @AuraEnabled public String home_phone {get;set;}	//7807997417
        @AuraEnabled public String email {get;set;}	//tboutilier@sawridge.com
        public String fax {get;set;}	//7804283335
        @AuraEnabled public cls_address address {get;set;}
        public cls_cleansed_address cleansed_address;
    }
    public class cls_address {
        @AuraEnabled public String street {get;set;}	//530 MACKENZIE BLVD
        @AuraEnabled public String street2 {get;set;}	//VIPUL
        @AuraEnabled public String city {get;set;}	//FORT MCMURRAY
        @AuraEnabled public String state {get;set;}	//AB
        @AuraEnabled public String postal_code {get;set;}	//T9H 4C8
        @AuraEnabled public String country {get;set;}	//CA
    }
    public class cls_cleansed_address {
        public String street;	//530 MACKENZIE BLVD
        public String street2;	//VIPUL
        public String city;	//FORT MCMURRAY
        public String state;	//AB
        public String postal_code;	//T9H 4C8- 
        public String country;	//CA
    }
    public class cls_wm_metadata{
        public String library;	//202A
        public String company_code;	//949
        public String mas_account_number;	//949-663
        public String mas_status;	//WRTOFFCAN
        public String business_unit;	//B00269
        public String is_canadian_billed;	//True
    }
    public class cls_metadata {
        public String totalCount;	//1
    }
    public static JSON2Apex parse(String json){
        return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class);
    }
}

is there any workaround for me to display the values
hi, i was trying to display a nested json response in visualforce page via pageblocktable

public class JSON2Apex{
    public String request_tracking_id;    //12
    public cls_customers[] customers {get;set;}
    public cls_metadata metadata;
    public class cls_customers {
        public String id    {get;set;}//000131417543005
        public String status {get;set;}    //CANCELLED
        public String category {get;set;}    //OPEN MARKET
        public String line_of_business {get;set;}    //COMMERCIAL
        public String account_type {get;set;}    //master
        public String is_national_account;    //False
        public String is_central_billed;    //False
        public cls_contacts[] contacts {get;set;}
        public cls_wm_metadata wm_metadata;
    }
    public class cls_contacts {
        public String type {get;set;}    //service
        public String organization_name {get;set;}    //SAWRIDGE HOTEL
        public String name {get;set;}    //VIPUL
        public String home_phone {get;set;}    //7807997417
        public String email {get;set;}    //tboutilier@sawridge.com
        public String fax {get;set;}    //7804283335
        public cls_address address {get;set;}
        public cls_cleansed_address cleansed_address;
    }
    public class cls_address {
        public String street {get;set;}    //530 MACKENZIE BLVD
        public String street2 {get;set;}    //VIPUL
        public String city {get;set;}    //FORT MCMURRAY
        public String state {get;set;}    //AB
        public String postal_code {get;set;}    //T9H 4C8
        public String country {get;set;}    //CA
    }
    public class cls_cleansed_address {
        public String street;    //530 MACKENZIE BLVD
        public String street2;    //VIPUL
        public String city;    //FORT MCMURRAY
        public String state;    //AB
        public String postal_code;    //T9H 4C8- 
        public String country;    //CA
    }
    public class cls_wm_metadata{
        public String library;    //202A
        public String company_code;    //949
        public String mas_account_number;    //949-663
        public String mas_status;    //WRTOFFCAN
        public String business_unit;    //B00269
        public String is_canadian_billed;    //True
    }
    public class cls_metadata {
        public String totalCount;    //1
    }
    public static JSON2Apex parse(String json){
        return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class);
    }
}
This is the visualforce page
<apex:pageBlockTable value="{!res.customers}" var="r" >
                    <apex:column headerValue="Type" value="{!r.line_of_business}"></apex:column>  
                    <apex:column headerValue="Name" value="{!r.Name}"/>
                    <apex:column headerValue="Phone" value="{!r.home_phone}"/>
                    <apex:column headerValue="Email" value="{!r.email}"/> 
                    <apex:column headerValue="ShippingAddress"/>  
                </apex:pageBlockTable> 
I am not able to display the iteration details for the third time 
this is my component class:
<table class="slds-table slds-table_bordered slds-table_cell-buffer slds-table_striped">
.......
<tbody>
                <aura:iteration items="{!v.ResponseObj.customers}" var="cus">
                    <tr>
                        <th scope="row">
                            <div class="slds-truncate" title="{!cus.line_of_business}">{!cus.line_of_business}</div>
                        </th>
                        <aura:iteration items="{!cus.contacts}" var="cus1">
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.name}">{!cus1.name}</div>
                            </th>
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.home_phone}">{!cus1.home_phone}</div>
                            </th>
                            <th scope="row">
                                <div class="slds-truncate" title="{!cus1.email}">{!cus1.email}</div>
                            </th>
                            <aura:iteration items="{!cus1.address}" var="cus2">
                                <th scope="row">
                                    <div class="slds-truncate" >{!cus2.street}</div>
                                </th>
                            </aura:iteration>
                        </aura:iteration>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
this is the nested class that I am trying to display:
public class JSON2Apex{
    public String request_tracking_id;	//12
    @AuraEnabled public cls_customers[] customers {get;set;}
    public cls_metadata metadata;
    public class cls_customers {
        public String id	{get;set;}//000131417543005
        public String status {get;set;}	//CANCELLED
        public String category {get;set;}	//OPEN MARKET
        @AuraEnabled public String line_of_business {get;set;}	//COMMERCIAL
        public String account_type {get;set;}	//master
        public String is_national_account;	//False
        public String is_central_billed;	//False
        @AuraEnabled public cls_contacts[] contacts {get;set;}
        @AuraEnabled public cls_wm_metadata wm_metadata {get;set;} 
    }
    public class cls_contacts {
        public String type {get;set;}	//service
        public String organization_name {get;set;}	//SAWRIDGE HOTEL
        @AuraEnabled public String name {get;set;}	//VIPUL
        @AuraEnabled public String home_phone {get;set;}	//7807997417
        @AuraEnabled public String email {get;set;}	//tboutilier@sawridge.com
        public String fax {get;set;}	//7804283335
        @AuraEnabled public cls_address address {get;set;}
        public cls_cleansed_address cleansed_address;
    }
    public class cls_address {
        @AuraEnabled public String street {get;set;}	//530 MACKENZIE BLVD
        @AuraEnabled public String street2 {get;set;}	//VIPUL
        @AuraEnabled public String city {get;set;}	//FORT MCMURRAY
        @AuraEnabled public String state {get;set;}	//AB
        @AuraEnabled public String postal_code {get;set;}	//T9H 4C8
        @AuraEnabled public String country {get;set;}	//CA
    }
    public class cls_cleansed_address {
        public String street;	//530 MACKENZIE BLVD
        public String street2;	//VIPUL
        public String city;	//FORT MCMURRAY
        public String state;	//AB
        public String postal_code;	//T9H 4C8- 
        public String country;	//CA
    }
    public class cls_wm_metadata{
        public String library;	//202A
        public String company_code;	//949
        public String mas_account_number;	//949-663
        public String mas_status;	//WRTOFFCAN
        public String business_unit;	//B00269
        public String is_canadian_billed;	//True
    }
    public class cls_metadata {
        public String totalCount;	//1
    }
    public static JSON2Apex parse(String json){
        return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class);
    }
}

is there any workaround for me to display the values