1
chenjingwu
2024-04-10 9168a7e089c1bae5714902ba7c61109168e6972b
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<apex:page controller="DemoController" action="{!getAccountForVF}">
    <head>
        <style type='text/css'>
            .customPopup{
                background-color: white;
                border-style: solid;
                border-width: 2px;
                left: 20%;
                padding: 10px;
                position: absolute;
                z-index: 9999;
                width: 500px;
                top: 20%;
            }
            .customPopup .close{
                position: absolute;
                top: 10px;
                right: 10px;
                transition: all 200ms;
                font-size: 20px;
                text-decoration: none;
                color: #333;
            }
            .customPopup .close:hover{
                color: red;
            }
        </style>
    </head>
    <apex:form >
        <apex:pageblock id="acctable">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="新增客户" action="{!showPopup}" reRender="popup" />
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!accList}" var="account">
                <apex:column headerValue="Name">
                    <apex:outputField value="{!account.Name}" />
                </apex:column>
                <apex:column headerValue="Type">
                    <apex:outputField value="{!account.Type}" />
                </apex:column>
                <apex:column headerValue="Phone">
                    <apex:outputField value="{!account.Phone}" />
                </apex:column>
                <apex:column headerValue="Fax">
                    <apex:outputField value="{!account.Fax}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageblock>
        <apex:outputPanel id="popup">
            <apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}" id="firstpopup">
                <apex:commandLink value="X" action="{!closePopup}" styleClass="close" rerender="popup"/>
                <apex:pageBlock >
                    <apex:pageBlockSection title="新增客户">
                        <apex:inputField value="{!newAcc.Name}" />
                        <apex:inputField value="{!newAcc.Type}" style="width: 130px" />
                        <apex:inputField value="{!newAcc.Phone}" />
                        <apex:inputField value="{!newAcc.Fax}" />
                    </apex:pageBlockSection>
                </apex:pageBlock>
                <apex:commandButton value="确认" action="{!addAccountForVF}" reRender="acctable,popup"/>
            </apex:outputPanel>
        </apex:outputPanel>
        <!-- <apex:selectList value="{!countries}" multiselect="true">
            <apex:selectOptions value="{!items}"/>
            <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
        </apex:selectList><p/>
        <apex:outputPanel id="out">
            <apex:actionstatus id="status" startText="testing...">
                <apex:facet name="stop">
                    <apex:outputPanel >
                        <p>You have selected:</p>
                        <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
                    </apex:outputPanel>
                </apex:facet>
            </apex:actionstatus>
        </apex:outputPanel> -->
    </apex:form>
</apex:page>