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
dsh210@lehigh.edudsh210@lehigh.edu 

Using <apex:repeat> to create dynamic columns

Hey all,

 

What I am trying to do here is create dynamic columns based on some attributes. However, I am getting a complaint that <apex:column> needs to be the direct child of <apex:pageTable>. Is there any way I can get those columns to repeat through the object's attributes? I found one solution that uses standard HTML <table>'s, etc, but that loses all the SF formatting, which is very important on this project.

 

Here is what I was trying:

 

<apex:repeat value="{!AttrDefs}" var="attr">
  <apex:column>
    <apex:facet name="header">
<apex:outputLabel value="{!attr.Name}"/>
</apex:facet> <apex:inputText value="{!row.col1}" /> </apex:column> </apex:repeat>

Thanks for suggestions!

imuino2imuino2

Why don't you try with apex:dataTable

You can have more info in http://yourorg/apexpages/apexcomponents.apexp

There you will find all the info about apex components.

Ignacio.

dsh210@lehigh.edudsh210@lehigh.edu

 

Unfortunately, it still throws the same direct child error:

 

 
ErrorError: <apex:column> must be the direct child of either <apex:dataTable> or <apex:pageBlockTable>
SteveBowerSteveBower

Post all your code.  (And look at the   heaverValue   atribute on apex:column which might be used instead of your header facet.

stephanstephan

This isn't going to be possible today. We are working on supporting this (as well as some other features to support "dynamic binding") for the Winter '11 release. Stay tuned...

 

...stephan

 

TehNrdTehNrd

Doesn't look like this made it in Winter 11. So.....how about Spring 11, pretty please. :-D

stephanstephan

Unfortunately we couldn't get this to GA for Winter '11. We are making it avaialble selectively as a pilot feature, however. After the Winter '11 release, feel free to contact me and I'll see what I can do.

magdielmagdiel

Any updates ? We are maintaining a bunch of very hard to maintain code just because of this