This tag acts as a placeholder for your dynamic Apex components. It has one required parameter—componentValue—which accepts the name of an Apex method that returns a dynamic component.
public class SimpleDynamicController { public Component.Apex.Detail getDynamicDetail() { Component.Apex.Detail detail = new Component.Apex.Detail(); detail.expressions.subject = '{!acct.OwnerId}'; detail.relatedList = false; detail.title = false; return detail; } // Just return the first Account, for example purposes only public Account acct { get { return [SELECT Id, Name, OwnerId FROM Account LIMIT 1]; } } }
<apex:page controller="SimpleDynamicController"> <apex:dynamicComponent componentValue="{!dynamicDetail}" /> </apex:page>

No comments:
Post a Comment