-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContactViewAdd.vfp
41 lines (41 loc) · 2.12 KB
/
ContactViewAdd.vfp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<apex:page controller="ContactsViewAddController" tabStyle="Contact">
<apex:form id="parentForm">
<apex:pageMessages />
<apex:pageBlock title="Add Contacts" id="addContactsDiv">
<apex:pageBlockTable value="{!contactsToAdd}" var="cont">
<apex:column headerValue="First Name">
<apex:inputField value="{!cont.FirstName}"/>
</apex:column>
<apex:column headerValue="Last Name">
<apex:inputField value="{!cont.LastName}"/>
</apex:column>
<apex:column headerValue="Phone">
<apex:inputField value="{!cont.Phone}"/>
</apex:column>
<apex:column headerValue="Email">
<apex:inputField value="{!cont.Email}"/>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!addContact}" value="Add Contact" reRender="addContactsDiv"/>
</apex:pageBlockButtons>
</apex:pageBlock>
<apex:pageBlock title="View Contacts" id="viewContactsDiv" rendered="{!isSaved}">
<apex:pageBlockTable value="{!contactsToView}" var="cont">
<apex:column headerValue="First Name" value="{!cont.FirstName}"/>
<apex:column headerValue="Last Name" value="{!cont.LastName}"/>
<apex:column headerValue="Phone" value="{!cont.Phone}"/>
<apex:column headerValue="Email" value="{!cont.Email}"/>
</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:repeat value="{!pageNumberArray}" var="pageNumber">
<a href="javascript:viewItem('{!pageNumber}');"> {!pageNumber} </a>
</apex:repeat>
<apex:actionFunction action="{!changePage}" name="viewItem" reRender="parentForm" immediate="true">
<apex:param name="selectedPgNo" value="" assignTo="{!selectedPageNumber}"/>
</apex:actionFunction>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>