+ Start a Discussion
ciccic 

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:component>
<apex:attribute name="myValue" description="Value to show" type="String"/>
<apex:outputText value="{!myValue}"/>
</apex:component>
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>
         </apex:pageBlockList>
           </apex:pageBlockSection>

 
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?
 
 
dchasmandchasman
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.
GoForceGoGoForceGo
I have similar issue under the thread:

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=918

Will it be fixed in Summer 08 release as welll?