You need to sign in to do that
Don't have an account?
Pallavi Ghole
pageBlockTable not displaying data
I am currently on a VisualForce course by Matt Lacey and having trouble with the Apex code for DataList / PageBlockTable.
Though my apex code does not show any errors the page does not display any records. Any help/direction would be appreciated.
Here is the Code
=============
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Account List">
<apex:pageBlockTable value="{!accounts}" var="acct">
<apex:column >
<apex:outputField value="{!acct.Name}"/>
</apex:column>
<apex:column >
<apex:outputField value="{!acct.Rating}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Any idea what I may be doing wrong?
Or is there a setup needed to display this data?
Regards
Pallavi
Though my apex code does not show any errors the page does not display any records. Any help/direction would be appreciated.
Here is the Code
=============
<apex:page standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Account List">
<apex:pageBlockTable value="{!accounts}" var="acct">
<apex:column >
<apex:outputField value="{!acct.Name}"/>
</apex:column>
<apex:column >
<apex:outputField value="{!acct.Rating}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Any idea what I may be doing wrong?
Or is there a setup needed to display this data?
Regards
Pallavi
All Answers
OK so an interesting thing is - THe page is showing me a new account that I created after I finished writing this VF code but it still does not show me existing account records. Not sure why
An interesting thing is - It is showing me a new account that I created after I finished writing this VF code but it still does not show me existing account records.
Your response below helped!
"Your code is correct ... But recordSetVar will show the data from the from the ListView which you access currently. Please change the list view on account object to All Accounts or my accounts and try to reload your visualforce page "