高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
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
<apex:component controller="viewShareSurveyComponentController" allowDML="true">
<apex:attribute name="surveyId" description="The survey to use" 
                  type="Id" required="required" assignTo="{!surveyId}"/>
 
<apex:form id="theForm">
<apex:pageblock title="{!$Label.LABS_SF_Share_My_Survey}">
<apex:pageblocksection columns="1">
<apex:pageblocksectionitem >
<apex:outputLabel for="urlOptions" value="{!$Label.LABS_SF_Sharing_Options}" />
<apex:selectList id="urlOptions" value="{!selectedURLType}" size="1">
    <apex:selectOptions value="{!urlType}" />
 <apex:actionSupport event="onchange" rerender="theForm"/>
    
</apex:selectList>
</apex:pageblocksectionitem>
 
<apex:pageblocksectionItem rendered="{!selectedURLType == 'Chatter'}" >
<apex:outputLabel for="chatterLink" value="{!$Label.LABS_SF_Chatter_Link} " />
<apex:outputText id="chatterLink" value="{!surveyURLBase + surveyURL}" /> 
</apex:pageblocksectionItem>
</apex:pageblocksection>
 
 
 
<apex:pageblocksection columns="1" rendered="{!selectedURLType != 'Chatter'}">
<apex:pageblocksectionitem >
<apex:outputLabel for="sitesList" value="Select Site " /> 
<apex:selectList value="{!surveySite}" multiselect="false" id="sitesList" required="true"  size="1">
            <apex:selectOptions value="{!sitesPicklist}"/>
             <apex:actionSupport event="onchange" rerender="emailLink"/>            
</apex:selectList>
</apex:pageblocksectionitem>
<apex:pageblocksectionitem >
<apex:outputLabel for="emailLink" value="Emailable Link " />
<apex:outputText id="emailLink" value="{!surveyURLBase + surveyURL}" /> 
</apex:pageblocksectionitem>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
 
<apex:iframe src="{!surveyURLBase + surveyURL}" scrolling="True" />
 
</apex:component>