All,
I am trying to use dynamicComponent to build a PageBlockTable.
In the controller I want to iterate over each element and perform certain operations.
My VF page looks something like this
<apex:page standardController="{!OBJECT NAME}" recordSetVar="attrs" extensions="Ext">
<apex:dynamicComponent componentValue="{!dynamicPageBlockTable}"/>
And relevant controller code looks like
public Component.Apex.PageBlockTable getDynamicPageBlockTable() {
Component.Apex.PageBlockTable pbt = new Component.Apex.PageBlockTable();
pbt.expressions.value = '{!attrs}';
pbt.var = 'a';
Component.Apex.column column = new Component.Apex.column();
column.expressions.value = '{!a.id}';
pbt.childComponents.add(column);
return pbt;
}
With this code, VF page displays all the ids. But I want to iterate over all the values present in {!attrs}
and then perform some additional actions.
Is this possible?
Added: Just to elaborate on what I want to do...
This code...
pbt.var = 'a';
Component.Apex.column column = new Component.Apex.column();
column.expressions.value = '{!a.id}';
pbt.childComponents.add(column);
works fine and I can see all the IDs on VF page. But what I want to do is something similar to
for (each id in {!attrs}) { get information like name, owner related to id based on the information build a VF component such as list, checkbox add this component to column }