1

I'm Displaying two types of lists in Lightning component. One is List of OpportunityTeamMember and other is List of case. But when I'm iterating over List of Opportunity team members I'm able to see data in table. where When I'm iterating over case List, Columns were blank. Why am I not able to see values in case table?

Below is my code.

<aura:if isTrue="{!v.hasTeamMems}">
    <p><b>Opportunity Team Member List</b></p>
        <table class="slds-table slds-table--bordered slds-table--cell-buffer">
            <thead>
                <tr class="slds-text-title--caps">
                    <th style="width:3.25rem;" class="slds-text-align--right">
                        <div class="slds-form-element">
                            <div class="slds-form-element__control">
                                <label class="slds-checkbox">
                                    <!--header checkbox for select all-->
                                    <ui:inputCheckbox aura:id="selectAllTeamMem" change="{!c.selectAll}"/>
                                    <span class="slds-checkbox--faux"></span>
                                    <span class="slds-form-element__label text"></span>
                                </label>
                            </div>
                        </div>
                    </th>
                    <th><span class="slds-truncate" title="Name">Team Member</span></th>
                    <th><span class="slds-truncate" title="Name">Access Level</span></th>
                    <th><span class="slds-truncate" title="Name">Member Role</span></th>
                </tr>
            </thead>
            <tbody>

                <aura:iteration items="{!v.ListOfOppTeamMems}" var="teamMems">
                    <tr>
                        <td scope="row" class="slds-text-align--right" style="width:3.25rem;">
                            <div class="slds-form-element">
                                <div class="slds-form-element__control">
                                    <label class="slds-checkbox">
                                        <ui:inputCheckbox text="{!teamMems.Id}" aura:id="teamMemsBox" value="" change="{!c.checkboxSelect}"/>
                                        <span class="slds-checkbox--faux"></span>
                                        <span class="slds-form-element__label text"></span>
                                    </label>
                                </div>
                            </div>
                        </td>
                        <td scope="row"><div class="slds-truncate" title="{!teamMems.Name}">{!teamMems.Name}</div></td>
                        <td scope="row"><div class="slds-truncate" title="{!teamMems.OpportunityAccessLevel}">{!teamMems.OpportunityAccessLevel}</div></td>
                        <td scope="row"><div class="slds-truncate" title="{!teamMems.TeamMemberRole}">{!teamMems.TeamMemberRole}</div></td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
    </aura:if>
   <aura:if isTrue="{!v.hasCases}">
    <p><b>Cases List</b></p>
        <table class="slds-table slds-table--bordered slds-table--cell-buffer">
            <thead>
                <tr class="slds-text-title--caps">
                    <th style="width:3.25rem;" class="slds-text-align--right">
                        <div class="slds-form-element">
                            <div class="slds-form-element__control">
                                <label class="slds-checkbox">
                                    <!--header checkbox for select all-->
                                    <ui:inputCheckbox aura:id="selectAllCases" change="{!c.selectAll}"/>
                                    <span class="slds-checkbox--faux"></span>
                                    <span class="slds-form-element__label text"></span>
                                </label>
                            </div>
                        </div>
                    </th>
                    <th><span class="slds-truncate" title="Name">Case Number</span></th>
                    <th><span class="slds-truncate" title="Name">Case Origin</span></th>
                    <th><span class="slds-truncate" title="Name">Reason</span></th>
                </tr>
            </thead>
            <tbody>

                <aura:iteration items="{!v.ListOfCase}" var="casRecs">
                    <tr>
                        <td scope="row" class="slds-text-align--right" style="width:3.25rem;">
                            <div class="slds-form-element">
                                <div class="slds-form-element__control">
                                    <label class="slds-checkbox">
                                        <ui:inputCheckbox text="{!casRecs.Id}" aura:id="casesBox" value="" change="{!c.checkboxSelect}"/>
                                        <span class="slds-checkbox--faux"></span>
                                        <span class="slds-form-element__label text"></span>
                                    </label>
                                </div>
                            </div>
                        </td>
                        <td scope="row"><div class="slds-truncate" title="{!casRecs.caseNumber}">{!casRecs.caseNumber}/></div></td>
                        <td scope="row"><div class="slds-truncate" title="{!casRecs.Origin}">{!casRecs.Origin}</div></td>
                        <td scope="row"><div class="slds-truncate" title="{!casRecs.Reason}">{!casRecs.Reason}</div></td> <!-- {!cases.Reason} -->
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
    </aura:if>

In javascript controller.

            if(teamMem!= null && teamMem.length>0){
                component.set("v.hasTeamMems",true);
                component.set("v.ListOfOppTeamMems",teamMem);
            }           

            if(cases!=null && cases.length>0){
                component.set("v.hasCases",true);
                component.set("v.ListOfCase",cases);                    
            }
  • can you post your controller and make sure there is no error being returned/ not a void method/ marked with @auraenabled etc.. also put a console inside the cases!=null to make sure the listofcases is being set? – Rao Nov 2 '17 at 21:18
  • 1. do you see any specific column blank or complete table is not visible? 2. Post your complete code (cmp, js, apex class). One thing which I can notice is c is in small case in caseNumber – Himanshu Nov 3 '17 at 3:35
  • It's because of case sensitivity for fields name. I have corrected and made changes in my code, but forgot to update here. Thanks for help guys. – user1570555 Nov 13 '17 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.