2015-10-16 49 views
1

我是銷售人員發展的新手。我無法在社區用戶訪問的可視化頁面中創建自定義對象記錄表。我可以通過使用包裝類訪問個人記錄。然而,我不能顯示一個表,如果我在頂點使用包裝對象列表:重複值,我得到這個錯誤(因爲它們不是SObjects):需要社區用戶VF的自定義對象表

「只能與SObjects或Visualforce對象一起使用現場組件可解析「。

解決此問題後,我還需要支持內聯編輯。客戶社區用戶的自定義對象訪問是否受限?只有通過社區門戶進行訪問,問題纔會出現。實現內聯編輯自定義對象表的任何方式?

VF頁

<apex:page controller="FHController" > 
<apex:form > 
    <apex:repeat value="{!fhList}" var="rec"> 
     Series: <apex:outputField value="{!rec.Series__c}" /> 
    </apex:repeat> 
</apex:form> 
</apex:page> 

控制器

public class FHController { 
    public List<Funding_History__c> fhList {get; set;} 

    public FHController() { 
     String id = ApexPages.currentPage().getParameters().get('id'); 
     fhList = [SELECT id, Series__c, Date__c, Amount__c, Valuation__c, Investors__c FROM Funding_History__c WHERE Account__c = :id]; 
    } 

    public PageReference save() { 
     System.debug('COUNT: ' + fhList.size()); 
     update fhList; 
     return null; 
    } 
} 

謝謝!

回答

0

你不需要任何包裝類在VF頁面上顯示SObject。您只需選擇一組Funding_History__c對象並且不要包裝它。然後你就可以在{!fhList}變量的VF頁面上獲得這些對象。 對於內聯編輯,您可以使用頂點:inlineEditSupport。以下是來自SF文檔的報價:

此組件提供對 和各種容器組件的內嵌編輯支持。爲了支持內聯編輯,這個組件也必須在標籤內。

該組件只能是以下標籤的後代:「apex:dataList」,「apex:dataTable」,「apex:form」,「apex:outputField」,「apex:pageBlock」,「apex:pageBlockSection 「,」頂點:pageBlockTable「,」頂點:重複「。

參見:的inlineEdit屬性「頂點:細節」

這裏是簡短的例子是如何查找聯繫人對象(你的情況是很相似的,你只需要改變網頁控制器的sObject這你處理):

<apex:page standardController="Contact"> 
    <apex:form > 
     <apex:pageBlock mode="inlineEdit"> 
      <apex:pageBlockButtons > 
       <apex:commandButton action="{!edit}" id="editButton" value="Edit"/> 
       <apex:commandButton action="{!save}" id="saveButton" value="Save"/> 
       <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/> 
      </apex:pageBlockButtons> 
      <apex:pageBlockSection > 
       <apex:outputField value="{!contact.lastname}"> 
        <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
         hideOnEdit="editButton" event="ondblclick" 
         changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> 
       </apex:outputField> 
       <apex:outputField value="{!contact.accountId}"/> 
       <apex:outputField value="{!contact.phone}"/> 
      </apex:pageBlockSection> 
     </apex:pageBlock> 
    </apex:form> 
</apex:page> 

所以,你可以通過這種方式進一步調查。

0

爲什麼不使用<apex:pageBlockTable>?這也將解決你的第一個問題(不能顯示錶)。