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

Passing variables to customer components in a repeat or table in Visualforce

Is it possible to use a custom component within a repeating part of a Visualforce page (table, repeat, pageBlockList etc) where it needs part of the repeat variable passed to the component?
Component myComponent:
<apex:attribute name="myValue" description="Value to show" type="String"/>
<apex:outputText value="{!myValue}"/>
Part of page:
           <apex:pageBlockSection title="Test Section" columns="1">
                <apex:pageBlockList value="{!myData}" var="record">
   <apex:column headerValue="Sample"><c:myComponent value="{!record.Name}"/></apex:column>

in the page controller I link up GetMyData to return a custom object.
The page code fails compile with a mesage: Unknown property 'MyController.record'.
The controller and page all work since I can get the page to work fine without the customer component.
Is there is restriction on using custom components in repeating structures?  Or is this a bug?
That is a bug that has already been fixed in the Summer '08 release (no plans to backport to the current release at this time because we are in the final stages of prepping Summer '08 for deployment).

BTW there is a trivial error in your page that will surface when you are upgraded to Summer '08 - <c:myComponent value=""> should be <c:myComponent myValue=""> as you have defined c:myComponent. Once I fixed that your sample below ran perfectly on Summer '08.
I have similar issue under the thread:

Will it be fixed in Summer 08 release as welll?