You need to sign in to do that
Don't have an account?
Amit Ghadage
Can we Iterate over list of Dynamic Components on visualforce page
I need to iterate over list of dynamic components on visualforce page but its not working.
I tried with apex:repeat and apex:pageBlocktable tags on vf, With transient keyword and without transient keyword.
vf page
Controller
I tried with apex:repeat and apex:pageBlocktable tags on vf, With transient keyword and without transient keyword.
vf page
<apex:page StandardController="Account" extensions="testDynamicComponent "> <apex:form> <apex:pageBlock> <apex:repeat value = "{!dynamicComponents}" var = "d"> <apex:dynamicComponent componentValue = "{!d}"/> </apex:repeat > </apex:pageBlock> </apex:form> </apex:page>
Controller
public class testDynamicComponent { public testDynamicComponent(ApexPages.StandardController controller) { } public List<Component.Apex.InputField> getdynamicComponents() { List<Component.Apex.InputField> inputFieldList = new List<Component.Apex.InputField>(); transient Component.Apex.InputField inpField= new Component.Apex.InputField(); inpField.expressions.value = '{!Account.Name}'; inputFieldList.add(inpField); transient Component.Apex.InputField inpFldIndus = new Component.Apex.InputField(); inpFldIndus.expressions.value = '{!Account.Industry}'; inputFieldList.add(inpFldIndus); return inputFieldList; } }
May I suggest you please check with below link from stack exchange community with a similar issue on iterating dynamic components inside a controller using page block table.
- https://salesforce.stackexchange.com/questions/165343/how-to-iterate-over-pageblocktable-dynamic-component-inside-controller/165345
Please let us know if this helps.Thanks,
Nagendra.