You need to sign in to do that
Don't have an account?
Create a VF Page to Show Contact
Hi Friend,
I have a task to create a Visualforce Page that shows all contacts (say 50) with Email IDs
<apex:pageBlockTable value="{!Contact}" var="item">
but this shows only the field lable name, No value is getting papulated.
My Second question is I am not able to add columns for State and Mobile. It shows error - Error: Invalid field States for SObject Contact
I used this code for it - <apex:column value="{! item.State}"/>
My third Question is how to add Pagination on my page like first, last, next, and previous buttons.
I have a task to create a Visualforce Page that shows all contacts (say 50) with Email IDs
- The page should show 5 contacts at a time
- Pagination should be done. So there will be 50/5 = 10 pages
- Each of the pages should have First, Previous, Next, Last as links
- Each page should be numbered (Page 1, Page 2,....)
- Column Shoul be First Name, Last Name, Mobile, State, Email ID
<apex:pageBlockTable value="{!Contact}" var="item">
but this shows only the field lable name, No value is getting papulated.
My Second question is I am not able to add columns for State and Mobile. It shows error - Error: Invalid field States for SObject Contact
I used this code for it - <apex:column value="{! item.State}"/>
My third Question is how to add Pagination on my page like first, last, next, and previous buttons.
In contact phone and state are MobilePhone,OtherState so replace accordingly you will get value .
Please follow the below links for pagination .
https://hisrinu.wordpress.com/2012/01/09/pagination-using-standardsetcontroller/
http://forceguru.blogspot.in/2011/04/pagination-in-salesforce.html
https://hisrinu.wordpress.com/2012/01/09/pagination-using-standardsetcontroller (https://hisrinu.wordpress.com/2012/01/09/pagination-using-standardsetcontroller/)
https://developer.salesforce.com/page/Paginating_Data_for_Force.com_Applications
http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination
https://www.minddigital.com/how-to-create-pagination-within-salesforce
Thanks
Manoj