You need to sign in to do that
Don't have an account?
cic
in the page controller I link up GetMyData to return a custom object.
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?
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.
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=918
Will it be fixed in Summer 08 release as welll?