Salesforce chatter:userPhotoUpload Component 使用

来源:互联网 发布:新ubantu系统安装caffe 编辑:程序博客网 时间:2024/06/03 13:10


 1,chatter:userPhotoUpload 组件 在 VF Page中直接应用 ,前提是apex:page 的属性 showHeader="true"  即可直接应用 。

代码 如下: <chatter:userPhotoUpload showOriginalPhoto="true"></chatter:userPhotoUpload> 


2,有时我们做一些定制界面,是不需要Page Header 即showHeader="false" ,如果这个时候在页面中引用 photoUpload组件,需要加入其依赖的一些JS和CSS,代码如下:

<link href="/sCSS/37.0/sprites/1466024068000/Theme3/default/sf/elements.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript">                        window.sfdcPage = new GenericSfdcPage();                        function bodyOnLoad() {                setFocusOnLoad();                if (typeof(startSessionTimer) != 'undefined') {                    startSessionTimer();                }                if (typeof(ActivityReminder) != 'undefined') {                    ActivityReminder.initialize([], false, false);                }                if ((window.sfdcPage) && (sfdcPage.executeOnloadQueue)) {                    sfdcPage.executeOnloadQueue();                }                SearchClickLoggingUtil.setClickLoggingServletPath("/_ui/search/logging/SearchClickLoggingServlet");                new UnifiedSearchAutoCompleteElement("phSearchInput", "/_ui/common/search/client/ui/UnifiedSearchAutoCompleteServlet", 1, {}, true, null, "phSearchForm", ["div", "searchOwner", "asPhrase", "sen"], {}, true, 3, 100);                new UnifiedSearchButton("searchButtonContainer", "phSearchButton", "headerSearchRightRoundedCornerMouseOver", "phSearchForm");                if (window.PreferenceBits) {                    window.PreferenceBits.prototype.csrfToken = "VmpFPSxNakF4Tmkwd055MHhOMVF3T1RvMU5EbzFOQzQyT1RaYSxUY3NQS2MwUGZtT3hPVEhtSlh1NUpFLE1HVXdaalF3";                }            }            function bodyOnBeforeUnload() {                if ((window.sfdcPage) && (sfdcPage.executeOnBeforeUnloadQueue)) {                    sfdcPage.executeOnBeforeUnloadQueue();                }            }            function bodyOnFocus() {                closePopupOnBodyFocus();            }            function bodyOnUnload() {            }                        </script>



当然,最后别忘记调用JS ,如下:

 <body onload="if(this.bodyOnLoad()){bodyOnLoad()}"  >


0 0
原创粉丝点击