function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

PageblockTable with Dynamic Visualforce Components

I'm starting using DVC (pilot feature enabled) and I was wondering if the apex:column implementation of the PageBlockTable is incorrect or if I missed something. When trying to build a Pageblocktable an d iterate over a List<Contact> the column contains the right numbers of rows, but the values are not displayed. Instead, the VF meta-tag is diplayed: {!var.columnName}


My controller class looks like this (don't search any point in it, it's just a test...):

public with sharing class GenericMultiEditObjectController {
	public String objectName;
	public String ParentObjectId;
	public list<Contact> objList {get;set;}

	public GenericMultiEditObjectController(){
	private void mainInit(){
		Map<String,String> paramMap = ApexPages.currentPage().getParameters();
		if (paramMap.containsKey('object')) objectName = paramMap.get('object');
		if (paramMap.containsKey('parentObjectId')) parentObjectId = paramMap.get('parentObjectId');
		objList = new List<Contact>();
		for (Contact oContact:[select id, firstName,LastName from Contact limit 20]){
	public Component.Apex.PageBlockTable getRlTable(){
		Component.Apex.PageblockTable table = new Component.Apex.PageblockTable();
		table.var = 'genObj';

		Component.Apex.Column firstNameCol = new Component.Apex.Column();
		firstNameCol.value = '{!genObj.FirstName}';


		return table;



And my VF page:


<apex:page controller="GenericMultiEditObjectController">
	<apex:form >
		<apex:pageblock >
			<apex:dynamicComponent componentValue="{!rlTable}" />


I put the result in attachment...



Best Answer chosen by Admin (Salesforce Developers) 

topic closed:instead of using column.value='{!var.fieldName}'I should have used:column.expressions.value='{!var.fieldName}'