function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohammed CHOUKCHOUMohammed CHOUKCHOU 

Use the Salesforce Lightning Design System to Style Visualforce Pages Issue

Working through the Visualforce Mobile module  I want to do an exercise (3rd unit) that consists of displaying the contacts their names and phone numbers.
 
<apex:page showHeader="true" sidebar="true" standardController="Contact" recordSetVar="contacts">
<head>
<apex:slds />
</head>
<apex:repeat value="{!contacts}" var="c">
    <dl class="slds-list_horizontal slds-wrap">
        <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Contact Name:">{!c.Name}</dt>
        <dd class="slds-item_detail slds-truncate" title="Mobile Phone Number:">{!c.Phone}</dd>
    </dl>
</apex:repeat>
 tried this code,I have no errors, however the list of contacts is not displayed! I tried to display a simple text it works, so the problem is at the level of the apex repeat I think
apex visualforce community slds
Khan AnasKhan Anas (Salesforce Developers) 
Hi Mohammed,

Greetings to you!

Please try below code:
 
<apex:page standardController="Contact" recordSetVar="contacts">
    
    <apex:slds /> 
    
    <apex:repeat value ="{!contacts}" var = "c">
        <dl class="slds-list_horizontal slds-wrap">
            <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Frst Label">First Label:</dt>
            <dd class="slds-item_detail slds-truncate" title="Description for first label">{!c.Name}</dd>
            <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Second Label">Second Label:</dt>
            <dd class="slds-item_detail slds-truncate" title="Description for second label">{!c.Phone}</dd>
        </dl>
    </apex:repeat>
    
</apex:page>

Note: This page does not specify a filter in the request, so the page is displayed with the last used filter. For information on using filters with list controllers, see Using List Views with Standard List Controllers.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Mohammed CHOUKCHOUMohammed CHOUKCHOU
Hi Anas

Thank you for your answer but the problem still persists, nothing is displayed
Parmanand PathakParmanand Pathak
Hi Mohammed,

As you are using Standard Controller in your VF page , So In Order to display values, you have to pass the contactId in your VF Page.

Kindly pass ContactID in the url of your VF page as below - 
 
https://parmanandpathak-dev-ed--c.visualforce.com/apex/TestVF?id=0037F00000L41U2QAJ


Regards,
Parmanand Pathak