是的,您可以在關聯列表標籤上動態設置「列表」屬性的值,並且您可以通過Dynamic Visualforce進行設置。這個問題已經被問和簡潔回答了在這裏的Salesforce的堆棧換取任何未來的瀏覽器:
https://salesforce.stackexchange.com/questions/7531/apexrelatedlist-list-dontexistinallorgs-c-only-solveable-with-dynamic
這裏是通用的解決方案:
在自定義控制器,將一個函數添加動態生成RelatedList標記。我會從你的措辭,你已經訪問你的控制器子關係的完整列表承擔,因此爲了吐出全部列出一個街區,我會用這樣的:
public Component.Apex.OutputPanel getDynamicList()
{
Component.Apex.OutputPanel outPanel = new Component.Apex.OutputPanel();
for(String id : childNames) {
Component.Apex.RelatedList relList = new Component.Apex.RelatedList();
relList.list = id;
outPanel.childComponents.add(relList);
}
return outPanel;
}
在在那裏,您可以動態地將任何字符串設置爲「List」值,並通過迭代您的字符串列表來反覆添加相關列表對象。 (只需添加一個列表,刪除for循環,並使「id」字符串值與您希望顯示的特定關係無關)。
然後你visualforce頁面上,你可以使這個塊了使用動態visualforce標籤:
<apex:dynamicComponent componentValue="{!DynamicList}" />
(你可能知道的,公式化的值字段將挖出自動吸氣)
巨大的成功!