Guest User

Untitled

a guest
Apr 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <apex:page standardController="Contact">
  2. <apex:form>
  3. <apex:pageBlock title="Edit Contact">
  4. <apex:pageBlockSection columns="1">
  5. <apex:inputField value="{!contact.FirstName}"/>
  6. <apex:inputField value="{!contact.LastName}"/>
  7. <apex:inputField value="{!contact.Email}"/>
  8. </apex:pageBlockSection>
  9. <apex:pageBlockButtons>
  10. <apex:commandButton action="{!save}" value="save"/>
  11. <apex:commandButton action="{!cancel}" value="cancel"/>
  12. </apex:pageBlockButtons>
  13. <apex:pageBlockTable value="{!conList}" var="c">
  14. <apex:column headerValue="First Name">
  15. <apex:outputField value="{!c.Firstname}" />
  16. </apex:column>
  17. <apex:column headerValue="Last Name">
  18. <apex:outputField value="{!c.Lastname}" />
  19. </apex:column>
  20. <apex:column headerValue="Email">
  21. <apex:outputField value="{!c.Email}" />
  22. </apex:column>
  23. </apex:pageBlockTable>
  24. </apex:pageBlock>
  25. </apex:form>
  26. </apex:page>
  27.  
  28. public with sharing class ContactEditController {
  29. public contact c {get; set;}
  30. public List<contact> conList {get;set;}
  31. public ContactEditController(){
  32. c= new Contact();
  33. }
  34. public PageReference save(){
  35. insert c;
  36. conList= [select FirstName,LastName,Email from Contact where id=:c.id];
  37. return null;
  38.  
  39. }
  40. }
  41.  
  42. public ContactEditController(ApexPages.StandardController stdController) {
  43. //Initialize your contact variable here
  44. }
Add Comment
Please, Sign In to add comment