0

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>
</apex:page>

I 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

  • You are using recordSetVar but you have not specified any list to iterate? there is no custom controller. salesforce.stackexchange.com/questions/97423/… – Pranay Jaiswal Apr 17 at 10:34
  • @PranayJaiswal value="{!contacts}" – Abbes CHOUKCHOU Apr 17 at 10:41
  • @PranayJaiswal This is a valid syntax for recordSetVar. – sfdcfox Apr 17 at 10:41
  • I tried this in my developer org, your code works just fine copy-pasted. Consider setting up a debug log and see if you show any errors there. – sfdcfox Apr 17 at 10:43
  • @sfdcfox all debug log success everywhere but the list still does not show up – Abbes CHOUKCHOU Apr 17 at 12:29

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.